spring-projects / spring-data-neo4j

Provide support to increase developer productivity in Java when using Neo4j. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
http://spring.io/projects/spring-data-neo4j
Apache License 2.0
818 stars 616 forks source link

Extract API classes to a separate artifact #2397

Open aleksanderlech opened 2 years ago

aleksanderlech commented 2 years ago

Hello again,

In the previous version of spring-data-neo4j we had a possibility to add the ogm-annotations jar as a dependency and therefore create a shared Neo4j entities artifact.

In our scenario we have a service that writes to Neo4j and another one that only reads the modes. In such situation it makes sense to have a shared jar with neo4j model entities.

Since the 6.x changes the mapping annotations are no longer a separate artifact which forces us to include the whole spring-data-neo4j dependency:

dependencies { api 'org.springframework.data:spring-data-neo4j:6.1.5' }

We really would like to avoid that. Therefore I ask you guys whether its possible to extract the annotations/api related classes into a separate artifact. Especially the annotation classes residing in /org/springframework/data/neo4j/core/schema.

It would be also nice from the design perspective since the API does not change so often like the implementation does. Its nice to keep it separated.

meistermeier commented 2 years ago

I wonder which ogm-annotations jar you are referring to. There is nothing I am aware of. All the dependencies are defined in the ogm-core library. This library does also contain all the mapping code etc.

spring-projects-issues commented 2 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

aleksanderlech commented 2 years ago

I wonder which ogm-annotations jar you are referring to. There is nothing I am aware of. All the dependencies are defined in the ogm-core library. This library does also contain all the mapping code etc.

I am sorry for the late response. You were right, that was the ogm-core but still at least not the whole spring module and its dependencies. Therefore it could be even better if to create a small module containing only the annotation classes.

michael-simons commented 2 years ago

I wouldn't mind extracting a separate module in this project too much. What stands against it is the fact our @Node, @Id and some other annotations are meta-annotated with Spring Data commons one, so it wouldn't gain too much.

aleksanderlech commented 2 years ago

Hello Michael!

I understand but still think that it would be a step towards a good direction. I hope that in the future spring-data-commons considers the same step as I can imagine even more people having similar struggles there. I think that one of the good examples to follow are Jackson library as well as Java Validation API. Both are meant to be used with some POJOs and both of them keep their API separated from the implementation. I won't be insisting on this change to happen soon but at least leave a thought for the future and let you guys decide.

Have a great weekend :)