MVC and JavaServer Faces
When we speak of a view technology are we meaning the framework that we use to 开发者_如何学Gocreate the web pages like JSP or Facelets? Practically in the MVC pattern is it a PDL that render the VIEW?
In some Java EE books the MODEL is related to backing beans but, generally, in design patterns books the model is related to the data. So what's a MODEL?
When we speak of a view technology are we meaning the framework that we use to create the web pages like JSP or Facelets?
Both can be considered as view. Anything that your app puts to user is a view. For example if I show some reports to user in the form of PDF then it's a view. Technically it would be JasperReports View.
In some Java EE books the MODEL is related to backing beans but, generally, in design patterns books the model is related to the data. So what's a MODEL?
Model in broader term is your classes that simulates Business Model in your app. And I would say it is backing beans.
See Also
- What are the M V C in JSF framework
Please see http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html?page=1. It is very well explained here!
Following is an extract from a relevant part of the article.
A multitiered architecture partitions the whole system into distinct functional units—client, presentation, business-logic, integration, and enterprise information system (EIS). This ensures a clean division of responsibility and makes the system more maintainable and extensible. Systems with three or more tiers prove more scalable and flexible than a client-server system, in which no business-logic middle tier exists.
The client tier is where the data model is consumed and presented. For a Web application, the client tier is normally the Web browser. The browser-based thin client does not contain presentation logic; it relies on the presentation tier.
The presentation tier exposes the business-logic tier services to the users. It knows how to process a client request, how to interact with the business-logic tier, and how to select the next view to display.
The business-logic tier contains an application's business objects and business services. It receives requests from the presentation tier, processes the business logic based on the requests, and mediates access to the EIS tier's resources. Business-logic tier components benefit most from system-level services such as security management, transaction management, and resource management.
The integration tier is the bridge between the business-logic tier and the EIS tier. It encapsulates the logic to interact with the EIS tier. Sometimes, the combination of the integration tier and the business-logic tier is referred to as the middle tier.
Application data persists in the EIS tier. It contains relational databases, object-oriented databases, and legacy systems.
精彩评论