Java EE Knowledge Summary

Source: Internet
Author: User

Software 152 Wang Chengyan

What is tiered development?

A software development method that is small and divide-and-conquer.

features of layering:

1. Each floor has its own responsibility.

2. The previous layer does not care about the next layer of implementation details, the previous layer with the external interface provided by the next layer to use its function.

3. The previous layer calls the next layer of functionality, the next layer cannot invoke the function of the previous layer.

Benefits of tiered development:

1. Each layer focuses on the realization of its own function, which facilitates the improvement of quality.

2. Facilitate the Division of labor and Cooperation, improve development efficiency.

3. Facilitates the reuse of code.

4. Facilitate the extension of the program.

principle of encapsulation:

Each level exposes the interface outward, but hides the inner details.

Sequential access principles:

The next tier serves the previous tier, but not the service on the previous tier

To pass data using an entity class:

In a hierarchical structure, data is transferred between different tiers through entity classes

Summary of hierarchies:

DAO is located between business logic and persisted data, enabling access to persisted data

Mainly consists of DAO interface, DAO implementation class and entity class.

Database connection and Shutdown tool classes for code reuse

features of layered development:

Each floor has its own responsibilities.

The previous layer calls the next layer of functionality, the next layer cannot invoke the previous layer of functionality

advantages and principles of layered development:

It is easy to improve development quality, improve development efficiency, facilitate code reuse, facilitate program extension, and reduce the coupling of code.

Layering should adhere to the principle of encapsulation and sequential access

Transferring data between different tiers through entity classes

The entire JDBC application process:

1. Set up database Epet, build table

2. Create the entity class, and the corresponding data table is corresponding, class name: Entity belongs to the package name is (com.beiwo.epet.entity);

3. Create the DAO's base class interface class Basedao, class name:. Basedao belongs to the package name is: (Com.beiwo.epet.dao.BaseDao);

4. Create the DAO implementation class Basedaoimpl, class name: Basedaoimpl The package name is: (Com.beiwo.epet.dao.impl.BaseDaoImpl);

5. Create a specific table of DAO class, class name: Petdao-owned Package name: (Com.beiwo.epet.dao.PetDao);

6. Create a concrete table of DAO's implementation class, class name: Petdaomysqlimpl-owned package name (COM.BEIWO.EPET.DAO.IMPL.PETDAOMYSQLIMPL);

7. Create the interface class for the business logic layer, class name: Petservice-owned package name (Com.beiwo.epet.service.PetService);

8. Create the interface implementation class for the business logic layer, class name: Petservieimpl-owned package name (COM.BEIWO.EPET.SERVICE.IMPL.PETSERVIEIMPL);

9. Create a test class

Java EE Knowledge Summary

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.