What is Lattis?

Lattis is a MVC (Model - View - Controller) based framework for Microsoft .NET Web applications. It provides a FrontController to the application, which delegates user defined actions to specific distributed controller classes. Benefits of this approach are ease of handling requests made to the Web application and applying necessary policies, a centralized way of managing the choice of appropriate views and handling errors and minimization of application's control logic complexity. Detailed descriptions about the FrontController pattern can be found at MSDN or at Sun Microsystems.

Overview

The MVC paradigm was first introduced to build user interfaces in Smalltalk - 80. Its major concept is to break the application into three parts: the Model, the View and the Controller. The Model is an abstract representation of the process to be modeled, including its data and behaviour. The View is the screen representation of the model, hence responsible to render its contents. The Controller defines the way the user interacts with the application, informing the Model or the View to change when it's necessary.

Unfortunately, it's not possible to implement pure MVC applications with current Web technology. One of the reasons it happens is because there's no natural way for the Model to notify the View when it has changed. Also, the View doesn't usually asks directly to the Model information about its state. Thus, Lattis framework adopts a variation of the MVC paradigm, which is also called Model 2 - Strictly speaking, the Model 2 approach introduces a controller Servlet and other Java components to the application, as it was created by Sun Microsystems. However, the concept of the Model 2 can be taken to the .NET world without significant losses.

The idea behind Lattis is the same one used in Struts, a very successful Java framework developed by The Apache Software Foundation. Although Lattis is a lot simpler than Struts, the final result of using it is similar to the one obtained with JSF (Java Server Faces) technology, because it sums the effects of the FrontController pattern to the PageController pattern, which is the default implementation for .NET Web applications.

The most important piece of a Lattis application is a user created configuration file called Application.config. As the name says, this file carries configuration information about the application. Lattis loads this file into memory when the first HTTP (HyperText Transfer Protocol) request hits the Web server, thus when subsequent requests need to lookup for resources, they will use the previously cached data.

Resources configured in Application.config file are, among others, actions to be taken to handle a specific request, including its final destiny when all processing is done. It's also possible to determine a URI (Unified Resource Identifier) to which the request should be forwarded in case an exception is raised during the action execution.

There are still more resources that could be specified in Application.config file. Lattis is simple and extensible, hence it's pretty easy to override most of the framework classes to provide implementations that better fits the user needs. Naturally, all the necessary information must be declared in Application.config file.