why business logic should be moved out of JSP?

The main benefit of MVC is you can have multiple view and clean and separated architecture & Simplicity


Re usability

Suppose tomorrow you need same app running on a desktop app. then you can just change the view.


Testability

You can unit test your service methods, but you can’t simply unit test logic from view.


Maintainability

It is easy to understand the code from Service methods, also we can change it /release service api and maintain it easily


Version ability

You can give version to your API and maintain standard docs related to issues/updates if you use service API instead view for logic


See Also

Leave a Comment