Simple Explanation of SSH architecture and VO Po explanation

Source: Internet
Author: User

Role of Struts, spring, and Hibernate at various layers

1) struts is responsible for the web layer.

ActionFormBean receives the data submitted by the form on the webpage, processes the data through the Action, and forwards the data to the corresponding webpage. Defined in the struts-config.xml, ActionServlet loads.

2) spring is responsible for business layer management, that is, Service (or Manager ).

1. The service provides a statistical call interface for action to encapsulate the DAO of the persistent layer ,.

2. You can write your own business methods.

3. unified management of javabean

4. Declarative Transaction Management

5. Integrate Hiberante

3) Hiberante, responsible for the persistence layer and performing database crud operations

Hibernate provides OR/Mapping for the persistence layer.

It has a set of. hbm. xml files and POJO, which correspond to tables in the database. Then define DAO. These are classes used to deal with databases, and they use PO.

In the struts + spring + hibernate system,

The object calling process is: jsp-> Action-> Service-> DAO-> Hibernate.

The data flow direction is that ActionFormBean accepts user data. Action extracts the data from ActionFromBean and encapsulates the data into VO or PO. Then, it calls the Bean class at the business layer to complete various business processing and then forward. After receiving this PO object, the business layer Bean will call the DAO interface method to perform persistence operations.

Java (PO, VO, TO, BO, DAO, POJO) Explanation

PO (persistant object) Persistent object
The concept that appears during o/r ing. If there is no o/r ing, this concept does not exist. Usually it corresponds to the data model (database), and some business logic is processed. It can be viewed as a java object mapped to a table in the database. The simplest PO is to correspond to a record in a table in the database. A set of PO can be used for multiple records. The PO should not contain any operations on the database.

VO (value object) value object
It is usually used for data transmission between business layers. Like PO, it only contains data. However, it should be an abstract business object, which can correspond to a table or not. This is based on the business needs. I personally think it is the same as DTO (data transmission object) and transmitted on the web.

TO (Transfer Object), a data transmission Object
Objects transmitted between different tie (LINKS) of an application

BO (business object) business object
From the business model perspective, see the domain objects in the UML component domain model. Java objects that encapsulate the business logic, and perform business operations by calling the DAO method and combining PO and VO.

POJO (plain ordinary java object) Simple and rule-free java object
Pure traditional java objects. That is to say, in some Object/Relation
The Mapping tool can maintain the persisent of database table records.
The object is completely Java-compliant
Bean standards are pure Java objects without adding other attributes and methods. My understanding is the most basic Java
Bean. Only the attribute fields and the setter and getter methods are supported !.

DAO (data access object) data access object
Is a standard j2ee design mode of sun. There is an interface in this mode that is DAO, and its operation on the negative persistence layer. Provides interfaces for the business layer. This object is used to access the database. It is usually used in combination with PO. DAO contains various database operation methods. It combines PO with other methods to perform database operations. Stored in the middle of the business logic and database resources. With VO,
Provide database CRUD operations...

O/R Mapper object/relationship ing
After all mappings are defined, the O/R
Mapper can help us do a lot of work. Through these mappings, this O/R
Mapper can generate all SQL statements about saving, deleting, and reading objects. We no longer need to write so many lines of DAL code.

Entity Model)
DAL (data access layer)
IDAL (interface layer)
DALFactory)
BLL (business logic layer)
BOF Business Object Framework
SOA Service Orient Architecture Service-Oriented Design
EMF Eclipse Model Framework
Eclipse modeling framework

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.