mardi 13 juillet 2021

Decoupling JSP from service layer in spring boot

I'm working on project which uses Spring Boot + JSP and I'm struggling to decouple Service and Controller data.
Many times service ends up with logic which initializes DTOs, determines what operation can user do just so JSP can hide different parts of page, or which values are available for specific fields just so it can be used for dropdowns on JSP.
I don't like this because it makes services and DTOs that service returns too big and important business logic in services falls into the background.

I also what to keep my controllers small and therefore I am looking for architectural component to add into the Web layer, that will act in between service and controllers. I know how to implement this in java, but is there commonly known component/pattern for this purpose (like Validator is used for input validation)?
Does anyone have similar problems and what were your experiences with this topic?

Aucun commentaire:

Enregistrer un commentaire