The project I am working with uses JSF + Spring + Hibernate.
This is a design question that I have often been confused about.
I currently inherited a project that contains a dao -> service -> view -> controller “layered” approach.
The “Controller” layer / tier? currently has all logic and objects that interact with the front end. I have been told that it is good practice to separate this into two layers/tiers, where the “Controller” layer/tier only contains methods/objects that interact with the front end and a second layer (bm?) that contains all business logic used by the controller.
1st.) What would the purpose be of dividing up the controller in such a way?
2nd.) Is there anything wrong with leaving it the way it currently is?
1st.) What would the purpose be of dividing up the controller in such a way?You must handle the business logic in
Service Layer. Benefits of separating the business entities fromController/UI Layer:Business Layeroperations with multiple UIs. You can also use business layer to work as a web service.2nd.) Is there anything wrong with leaving it the way it currently is?If you are new to Layered Architecture it will take some time to understand and implement the desired layers. It depends on time frame and application requirements. If you are planning to use the above points in your application go with layered architecture otherwise go with current implementation.