Spring REST – business logic – Info Java
Hi, I am planning to write an application and I am currently validating what kind of an architecture I want to use. I don’t want to use the Spring MVC pattern anymore, as I want the view and data provider to be dettached. On the client I want to use Angular or React and then use restful web service/ajax to get data and refresh part of the page on the client side.
So I could call my webservices/backend from any clients such as android app, ios app, angular site etc.
I am not very experienced with Sprin data rest. I have done some tutorials and it was fascinating to see how fast you can build rest webservices. My problem is now where to put the business logic? If you develop an application you dont only want to get the data from the database but you also have business logic and in Spring MVC it would be usually located in the services. However, I am not sure where to put the business logic in a Spring Data REST application? Some middle tier is missing, where I can put my business logic.
I know there are validators, event handlers and custom controllers, but are they suited for applications with heavy business logic?
Am I wrong into thinking that SDR can be used for this kind of scenarios or is it just useful if you just want a rest API to the data?
Article Prepared by Ollala Corp