eclipse-basyx / basyx-java-server-sdk

MIT License
49 stars 42 forks source link

move org.eclipse.digitaltwin.basyx.core.LoggingPropertySourceLoader to new artifact basyx.springcore - would help to reduce dependencies to basyx.core #331

Open in-fke opened 4 days ago

in-fke commented 4 days ago

I would like to remove the dependency to spring-context spring-boot-starter from basyx.core in order to de-couple dependencies better, especially for BaSyx Clients. This may only be the first step in a couple of steps to eventually decouple the clients from Spring.

The class org.eclipse.digitaltwin.basyx.core.LoggingPropertySourceLoader is the only class in basyx.core that depends on spring-boot. It derives from org.springframework.boot.env.PropertiesPropertySourceLoader in order to log the location.

Then this derivative is used in these four projects:

  1. basyx.aasenvironment.component
  2. basyx.aasrepository.component
  3. basyx.conceptdescriptionrepository.component
  4. basyx.submodelrepository.component

in the file META-INF/spring.factories, stating org.springframework.boot.env.PropertySourceLoader=org.eclipse.digitaltwin.basyx.spring.LoggingPropertySourceLoader

My suggestion:

  1. split "basyx.core" into "basyx.core" and "basyx.springcore" (the name is analog to "basyx.mongodbcore")
  2. Move the class org.eclipse.digitaltwin.basyx.core.LoggingPropertySourceLoader to org.eclipse.digitaltwin.basyx.springcore.LoggingPropertySourceLoader
  3. Have the above four projects depend on "basyx.springcore"
  4. Remove dependencies from "basyx.core" to "spring-context" and "spring-boot-starter"
  5. Step 4 has the side effect, that other projects would rely on these transitive dependencies, adjust accordingly.

I have already the changes in a fork - I could make a PR for this.

Regards, Florian

in-fke commented 4 days ago

this would be the diff (not sure if I should simply create the PR) https://github.com/eclipse-basyx/basyx-java-server-sdk/compare/main...in-fke:basyx-java-server-sdk:main