Thursday, October 9, 2014

JSP MODEL 2 ARCHITECTURE



* What is the model 2 architecture ?

   - Model 2 architecture is an  approach used for developing web application.This architecture separate presentation logic from business logic.Beside this,Model 2 also have an additional component called controller.

   - In jsp,servlet acts as controller.The responsibility of controller is to process incoming request and instantiate a model-java object or bean to compute a business logic.It is also responsible for deciding to which jsp page the request should be forward.In other word,servlet  select suitable business logic(model) to process request.It also redirect the result to appropriate view.

* What is the purpose of model  2 architecture ?
   - The main purpose of model 2 architecture is to separate presentation logic from business logic.The components of model 2 architecture are as follows:
      + View.
      + Model.
      + Controller.



Thursday, October 2, 2014

JSP MODEL1 ARCHITECTURE


* What is the jsp model 1 architecture ?

   - Java server pages(jsp) presents two approaches for developing web application using jsp page.And model 1 architecture is one of the arpproaches for developing web application.

* What is the jsp model 1 architecture used to ?

   - Model 1 architecture enables web desigers to develop web application such that .It separates business logic from presentation logic.
   - In this model have no extra servlet involved in process.The request of client is directly sent to jsp pages.Which can communicate with javabean or another services.
   - JSP model 1 architecture has  a page centric architecture. In this architecture, the application is composed of a series of interrelated jsp pages.These jsp pages handles all aspect of application including presentation,control and business logic.
   - In this architecture,business logic and control decision is  hard-coded inside jsp pages.

* What are the advantages of this model architecture ? 

   - This architecture provides a more lighweight design for small,static application.
   - It provide the separation of the presentation from content.

* What is the disadvantages of this model architecture ? 

   - It suffer from navigation problem.For example,if you change the name of the jsp page that is referenced to another pages .You must change name on many location.
  - Inflexible.
  - Difficult to mantaince.

MVC DESIGN PATTERN - FRAMEWORK

* What is the mvc ?



   - MVC architeture is the design pattern.That is used to design a reuseable apllication.Because it separates data(model) from view (user inteface) so that you can easily change view(user interface) without changing data and business logic of application.

      + Model presents data and business logic of application .Model does not depending on the view and controller.
      + View displays model data and send user action(eg button clicks) to the controller for processing.
      + Controller is used to control  the interaction between the view and model.It provide model data to view and interpret user action such as button click.The controller depends on the model and view.

* The relationships bettwen MVC components .

   - View and controller relationships.
      + Controllers are responsible for creating and selecting view
   - Model and view relationship.
      + View depends on the model.If  a change is made to the model then there might be a requirement to make parallel changes in the view.
   - Model and controller relationship.
      + The controller depends on the model.If a change is made to the model then might be a riquirement to make parallel chages in the controller.

* What is the framework.

   - Framework is the library.It provides a set of class classes to help programmers develops application easier and faster.