Assignment

What is MVC ?
MVC is an architecture stands for Model-View-Controller , which is used by the developers to implement the application to provide the huge flexibility and try to reduce the complexity at code level by separating the application into layers such as implementation of business logic at different layer , implementation of presentation and application at different layers. If all these things are implemented at one place then it is too difficult to maintenance. This module reduce the coupling between presentation logic and business logic and application logic. As I said above this architecture divide the web application into three layers :

Model :Model layer contains the business logic and functions that manipulate the information related to business data. After manipulation of business data it provide data to view layer for user or client. Model would database query for example CRUD(Create , Read , Update , Delete) operation. Model is not aware of presentation data and how that data will be displayed to the user. Model represents the application data contains the logic to manipulate and access the data. Any data that is part of persistent state are reside in model. Model groups related data and operations to provide specific service.

It should be clear.View :view is responsible for rendering the data given by the model . What should the application model be doing ? . then. a controller design must accommodate input from various types of clients including HTTP requests from web clients . Whenever the user sends a request for something then it always go through the controller. To solve that . which in turn interprets and translates the request to the appropriate request handlers. Md represents application model knows may be a view exists and that need some way to bind it. the whole problem and nothing but the problem. where the view is responsible for calling the model when it needs to retrieve the most current data. Because model don't know view exists . But confusion arise how much power a model deserved . This can be achieved by using a push model. Controller :controller is responsible for intercept and translate user inputs into actions that are performed by the model. Md(Domain model) and Ma(Application model) :- Model is a set of classes which model and support the underlying problem . The domain classes will truly know nothing about the mechanisms that interface them to the outside world. here proposed a new architecture name MdMaVC Md represents to domain model that is core work of application without knowing a view exists. It is the responsibility of the view to maintain consistency in representation when some changes in model. View uses the query method to obtains the contents and render it. what the domain model classes’ objects will be doing—supporting and modelling the problem. The controller is responsible for selecting the next view based on user input and the outcome of model operations. It access the enterprise data through the model and represent this information in understandable form for the browser. It is consisting a set of objects which represents a essence of problem for example invoice and booking. incoming HTTP requests are routed to a controller. the controller can decided the next view for generating the correct response. where the view registers itself with the model for change notifications. So the problem of communication between model and view is solved. or a pull model. Means if the information in the changed in the model it is the responsibility of the view to represent it. View is not depends on the application logic but it depend on what application logic done and give to the view for represent. After the action has been taken on the data. Depending on the outcome of this interaction. However. the controller is responsible for directing the appropriate view to the user.

These messages will be sent when events occur. the model communicate with the view via events. Views register handlers for the events they wish to handle. these view components will receive event notifications such as needs contents. Application model to Domain model communication : How it the domain model connected to the application model? The simplest scheme is to put the domain model object(s) into the application model as instance variables and to give the application model knowledge of what accessor and update methods of the domain model classes it should use.The application model is the object that knows that views exist and that those views need some way of obtaining information and notification. View to model communication : The views know of the model and will interact with the model (1) If a button is clicked an action message might be sent to a model object in order to get something done. a series of when: event send: message to: recipient expressions will be used. (2) If a new value is typed into an entry field an update message might be sent to a model object in order to give it its new value. with minimal dependencies. The events will often come from the controller. The recipient of the message will be the application model. In Smalltalk. or clicked. (3) If a value is needed for a display an enquiry message might be sent to a model object in order to get a value. an entry field or a radio button—as examples. Model (and controller) to view communication : model does not know about the view but surely the model need to make communication with view. So when the clicked event occurs. Using graphical components—a list box. set values or make things happen . Events provide nicely decoupled mechanisms that allow communication. during the setting up of a view. What happen if some values or information changes in model then this changes should know by view for update it self. a . It is then the job of the method in the application model responding to the message to obtain values.

JSP. Model in Ofbiz :-for model in ofbiz . Model implemented in ofbiz by making services and events that implement business logics. Screens etc Controller in ofbiz :-controller handled user request and response by application. Application model to domain model communication For communication between them put the domain model objects into the application model as instance variables and to give the application model knowledge of what accessor and update methods of the domain model classes it should use. Views in ofbiz :-for views or user interface ofbiz use many technologies like HTML . Form .xml are responsible for that kind of task. groovy . xml .button might send the recalibrate message to the application model that owns the view of which it is part. Controller. ofbiz framework use many technologies like java . FTL. In ofbiz Request Handlers. Control Servlet. . View Handlers.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.