Wednesday, January 30, 2013

MVC Architecture and Frame work

                                                                                                            Next-->


To design web applications sunmicrosystems provided the following two standard architectures.
1.       Model-I architecture or Model-I web architecture or MVC-I architecture.
2.       Model-II architecture or Model-II web architecture or MVC-II architecture.

Model-I Architecture:
  1. In the Model-I web application architecture we should use some jsp components to pick up the request and process that request.
  2.  As jsps are processing all the requests, this architecture is also called Jsp Front or page centric architecture.
  3.  In this architecture jsp’s acts as the views and as controllers and java beans as the model.


Disadvantages:
  1.  Model-I architecture designed on the basis of 2-tier architecture which will provide tightly coupled design for web applications.
  2. In Model-I architecture there is no clear separation between the components which are used for presentation and business processing.
  3.  In Model-I architecture we should use the existed jsp features may not be sufficient.  There may be a requirement to provide java code inside jsp pages, which is against for jsp specification.


Model-II Architecture:
  1.  In Model-II architecture we will use Servlet as controller; some set of jsps as view part and java beans, ejb’s as model.
  2.  As we use servlet as controller, this is called Servlet Front or Servlet Centric architecture.
  3. This architecture will provide loosely coupled design and which will provide clear separation between the components which are used for presentation and business processing.
  4. In this we should send all the requests to controller only not to view part and model part.
  5. In this architecture there are no restrictions on number of jsp pages utilization but all the jsps should not contain any java code.
  6.  Here we should not have page to page navigation, but we should have page controller to page navigation.
  7. Controller may interact with the model part for storing user state not for the sake of getting the data.
  8. And view part will interact with the controller for the sake of getting the data, not for storing the data.





Frame Work and Need of Framework:
  1.  If we want to design any web application on the basis of MVC architecture then we should explicitly provide the controller Servlet, internationalization support, data validation and respective exception handling mechanism along with the application logic even though they are common for every web application.
  2. As above requirements are common for every application it is better to have them as a predefined support.
  3.  To fulfill the above requirements some third party vendors have provided their own procedure called as frameworks.

Definition 1:
                It is a pre-fabricated software component that programmer can reuse, extend, customize to design customized web applications in the easiest manner.
Definition 2:
                It is semi implemented, reusable, customizable, sharable application which will provide very good environment to design and execute applications in the easiest manner.
Definition 3:
                Framework is collection of tools, utilities which will provide very good environment to design and execute customized web application in the easiest manner in less time.
Advantages:
  1.  Framework will reduce the development time by allowing parallel design.
  2.  Framework will reduce development cost as it was provided 50% of the application development.
  3. Framework will improve the productivity.
  4.  Framework will provide some generic services like login, security and transaction support etc.
Framework will provide default flow of execution for the web application, by this there is no need to check the flow of the execution explicitly.

No comments:

Post a Comment