Frameworks
The Model-View-Controller type of architecture sets a new benchmark for developers in enhancing customer experience while enhancing security. When placed in an Ajax based application, MVC becomes the framework wherein the JavaScript rendering is built automatically using an MVC type of format. The result is an Ajax based application with a strong background for MVC promising the same features of MVC architecture.
There are actually two types of MVC architecture today: the MVC1 and MVC2. Both of these frameworks follow the same philosophy of identifying model view and controller.
MVC1 is the simpler type of the architecture. The central point of this type of architecture is the JSP wherein it acts as the controller. Whenever an HTTP is activated, JSP controls the controller and view. The model or the data where it could be extracted will come from the JavaBean or another related component. That means, the business and presentation logic cannot be separated. The developer will have to work with controller and view at the same time so they are connected and will be implemented at the same time. Although it sounds really challenging for developers, MVC1 is surprisingly simple. Developers should be able to build MVC1 type applications in no time since it does not separate the functions altogether.
On the other hand, MVC2 is the robust version of MVC1. In fact, the proper definition of an MVC stems from the functions and features offered by MVC2.
In gist, MVC2 offers the separation of the business and presentation logic. Instead of limiting itself to JSP, MVC2 can be used with Servlets which acts as the controller. The model of the application is used with Java and the JSP is only used as the view.
MVC2 is usually used for developing complicated applications wherein MVC1 is used to build a simple application or to create a prototype for product presentation. The difference in security is also significant for MVC1 and MVC2. Since each component in MVC2 is treated separately, the model, view and the controller could be buffered with different sets of security that you need for your application.
Two more advantages could be found in MVC2: the codes reusability is possible in since each component could be built separately and could be later reused in another application. The single point of entry in an MVC2 ensures that the data flow is controlled and monitored with the proper security measure.
These types of MVC could be used in building an Ajax based application. In MVC1, developers will have the chance to build an asynchronous application. However, the security concerns in Ajax are enhanced further since the client side of the application is exposed to hackers. If you want to build simple Ajax based applications, MVC1 will work just fine.
On the other hand, MVC2 is more suited for the Ajax based application. When properly implemented, the framework of MVC2 envelopes the JavaScript within the architecture. The single point of entry may inhibit the full function of JavaScript, multiple views could still be activated ensuring that the Ajax based application is possible in MVC2.