I have multiple maven projects ( rest services ) with common domain model. I would not say micro services. Structure is build this way to eventually move towards mircoservices. All the maven projects have dependency on domain model package.

All custom validators are part of domain models package only. For validation of one of the model ( implementing constraintvalidator ) I need to consume or invoke API service from one of the other project ( which at the end is to get some data from common shared database across multiple services )

I thinking if making RestAPI call would be good approach or i should prefer code duplication in domain model. I can not move the model close to that service because this model is used by multiple services.

Any thoughts what would be better approach here?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.