Despite the idea of separating application's logic and view appeared in early 1980's with MVC (Model - View - Controller) pattern, seems like now it's a de facto standard for reliable and flexible applications development. One can even consider MVC to be an application framework which provides solution architecture.
There are lots of MVC implementations for Microsoft .NET platform. However, most of them use the following approaches:
- using infrastructural layer of an application: there is a so called MVC manager that executes controller's commands and notifies a view to update its state;
- using direct MVC management: after executing controller's command, there is a direct update call (notification signal) in the application.
Both these techniques are implicit as in the majority of cases you need to implement some unclear interfaces, know what MVC manager does, ensure that your string constants in a configuration file are up to date, remember to notify a view or execute controller's command properly, remember to add a correct attribute to some method, and so on. That's why we consider such approaches to be error-prone and therefore not reliable. Our Explicit MVC technique gives you the best solution for MVC implementation!
In our terms, controller is a class that derives from our AL.Application.Controller. Once your business logic is consolidated in public methods of this class, your view is updated after each public method (or property) call. On a sample code, numbers define the sequence of calls.
Note there are no special runners or object builders according to which application starts up. Everything is explicit! There are no tricks - the application just creates a SimpleController class instance, and calls its methods. Update comes automatically! So, you can completely concentrate on your business logic implementation and the way your view reflects changes. You don't have to think about how to make MVC work for you any more!
With our Explicit MVC you get the following:
- nothing is implicit: no string constants - your commands are represented as class methods, no object builders to start the application properly - you even can define new assembly at run-time and build new controller class via emit
- asynchronous controller method execution
- dynamic update listeners management (attaching/detaching listeners at run time)
- notifying update listeners whenever you want
- full control over the execution flow via metadata that is transferred.