How useful is a 'pure' MVC implementation?

jakarta-ee, java, model-view-controller, struts2

Solution

Your goal should be to get your business logic in one place. In my experience, if you can do that, your code base will be easier to develop, maintain, and change.

Model-view-controller is a way to get to that point, though in classic MVC, the business logic is in the (domain) model, while application logic is in the controller.

Application logic: if the user's next inspection date is within a week (or past due), show the 'schedule inspection' screen, otherwise show the 'inspection history' screen.

Business logic: restaurants that have previously failed inspection need to be inspected every six months, seafood restaurants must be inspected every year, and all other restaurants have to be inspected every two years. Given this restaurant's last inspection, when is their next inspection due?

Problem

I work at a company that provides custom made 'CRM'-like software. We are currently redesigning/redeveloping the software with the hopes that it will look more modern and be easier to develop and customize for future clients. Currently it takes a long time to customize each new application. There is a presumption that the reason it takes so long is because of the amount of business logic that is present in the 'view' layer. To some extent I can vouch for this being true, but symptoms don't always reliably point out a cause. There was a suggestion that if we just move the business logic to the controller layer and use pure view (we use java J2EE and struts) as in implementing struts tags instead of calling the bean layer and iterating objects right on the jsp - etc etc. Before I start advocating we go forward with this, I wanted to get a feeling for what other people thought. Does a "pure" implementation of the MVC (especially emphasis on decoupling the controller and the view) provide a cleaner, easier to develop and change code base? Thank all of you for the input - that has helped alot

Original source