Java Web practice topic-application layering

Source: Internet
Author: User

Independent ProgramFor example, Word Excel features: Advantages: fast speed, not affected by other environments. Disadvantages: It is difficult to configure dedicated programs, update, share functions, and data cannot be shared. C/S structureC Indicates client and client programs; s indicates server and server-side programs. Typical examples: Only databases (shared data) and QQ applications (functions are completed on two machines respectively, for each machine, sometimes it is a client or a server) features: the client still needs to install a separate application, and the server may be an application or a database. Some share only data, and some share functions. B/S structureB is browser. S indicates the server, which is the server. Features: no special client program is required, but a general browser is needed as the client. To maintain the program, you only need to do so on the server side. Multi-layer structureMulti-layer structure not only refers to Web applications, but we take Web applications as an example to describe the main difference between client programs and Web applications is Io. First: presentation layer (IO) business layer (function) data layer (data) Second: presentation layer (IO) control layer business layer (function) data layer (data) Third: the presentation layer (I/O) control layer business layer (function) data access layer data layer (data) third form is now popular, and is divided into sun's standard and popular combination. The following is an example: example 1: Official java standard presentation layer: JSP + EL + jstl control layer: servlet business layer: Session Bean + JavaBean data access layer: JPA + Entity Bean (BMP + CMP) data layer: DBMS Example 2: popular combination (STRUTS + hibernate) Presentation Layer: JSP + Struts tag library + formbean (used for passing values, belonging to JavaBean, but the function is mainly related to bidding data, so divide the presentation layer) control layer: struts central controller servlet + Action + struts-config.xml business layer: JavaBean data access layer: hibernate data layer: DBMS MVC ModeThe MVC pattern is very popular. What is the relationship with the above layering? In fact, the control layer is added to the layer above, and the MVC mode is implicitly used. In the MVC mode, both the business layer and the access control layer are part of the model. Note: JPA is a Java persistence API that is persistent. Encapsulate access to the database. Mentioned in ejb3. CMP and BMP are used in ejb2. (Container managed persistence, bean-managed persistence) Hibernate is also used to encapsulate access to the database and is called an O/R ing tool.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.