joomla/joomla-platform — pull request #1120 by LouisLandry (2012-04-04 18:30:55+00:00)
Title: Simplified foundational classes for Model, View and Controller.

This pull request introduces a new format for the model-view-controller paradigm. Principly, the classes `JModel`, `JView` and `JController` are now interfaces and the base abstract classes are now `JModelBase`, `JViewBase` and `JControllerBase` respectively. In additional, all classes have been simplified to remove a lot of coupling with the Joomla CMS that is unnecessary for standalone Joomla Platform applications.

One of the guiding principles of this change was to make the base implementations as non-prescriptive as possible. The Model, View and Controller classes simply wire up dependencies and get out of the developers way so that he or she can build things the way they make sense for the given application.

### Organization
All the API for controllers, models and views has moved from the Application package into separate Controller, Model and View packages respectively. Much of the API previously devoted to adding include paths for each of the classes has been removed because of improvements in the auto-loader or by registering or discovering classes explicitly using `JLoader`.

### Controllers
Controllers, by default, only support one executable task per class via the execute method. This differs from the legacy `JController` class which mapped tasks to methods in a single class. Messages and redirection are not always required so have been dropped in this base class. They can be provided in a downstream class to suit individual applications. Likewise, methods to create models and views have been dropped in favor of using application or package factory classes.

While it is easy to build a `JControllerTasker` (or in the case of the CMS a `JControllerCMS`) class that encompasses logic to support task mapping to controller methods, redirection, etc that has been removed, we strongly recommend considering using one controller to one action moving forward. The new `JControllerBase` class is very lightweight, and having one controller mapping to one task gives several benefits. One such benefit is the easy use of the HMVC pattern or chaining tasks. Another is the ability to serialize a controller with it's input and stored for later execution asynchronously. Either way, this implementation doesn't prescribe how you build and use controllers beyond an incredibly simple interface, and we believe that's a good thing.

### Models
Models have been greatly simplified in comparison to their legacy counterpart. The base model is nothing more than a class to hold state. All database support methods have been dropped except for database object support in `JModelDatabase`.

### Views
Views have also been greatly simplified. Views are now injected with a single model and a controller. Magic get methods have been dropped in favor of using the model directly. Similarly, assignment methods have also been dropped in favor of setting class properties explicitly. The `JViewHtml` class still implements layout support albeit in a simplified manner.