Java Application Hierarchical Architecture and Software Model

1. The layered architecture of the application

Presentation layer, business logic layer, database layer,

1.1.1 Distinguish between physical layer and logical layer

Physical Layers: Each layer runs on a separate machine node on the network. Distributed software system.

Logical layering: Each layer is implemented by relative software modules to complete specific functions.

1.1.2 Features of the software layer

  • Each layer consists of a set of related classes or components that work together to accomplish a specific function
  • There is a top-down dependency between layers. The upper layer components access the API of the lower layer components, and the lower layer should not depend on the upper layer. i.e. decoupling.
  • Each layer exposes API to the upper layer

1.1.3 Persistence Layer of Java Applications

To separate data access details from business logic, data access can be treated as a separate persistence layer.

Persistence layer utilizes ORM software, such as: Hibernate as an intermediate component

(Intermediate components: connection pipelines between applications and other software systems, Hibernate can be seen as a pipeline between Java applications and relational databases)

The persistence layer encapsulates the details of data access, what are the benefits?

  • High code reuse
  • Ability to support multiple database platforms
  • Relatively independent, changes will not affect the implementation of the upper layer

2. Software model

1. Conceptual model

It is used to simulate real entities in the problem domain (modeling), describing the concepts and properties of each entity, and the relationships between entities.

2. Relational data model

Based on conceptual models, used to describe the static structure of relational data

Content composition: (the components of the table do not contain business meaning)

  • one or more tables
  • all indexes on the table
  • view
  • trigger
  • Referential integrity between tables

3. Domain Model

Created on the basis of the conceptual model, the domain model is object-oriented.

composition:

Domain objects with behavior and state

Relationships between domain objects

4. Domain Object

A software abstraction of real-world entities.

    Entity domain object: POJO (need to persist)

    Process Area Objects: Represent business logic or processes. Such as: customers place orders, log in applications, etc. as process domain objects

    Event domain objects: represent some events of the application (exceptions, warnings, timeouts, etc.)

5. Relationships between domain objects

    1. Association: Refers to the reference relationship between classes. (somewhat like DI in Spring)

    2. Dependence

    3. Aggregation: Similar Associations

    4. Generalization: Inheritance between classes

6. Persistence concept of domain objects

  • Represented in memory as entity domain objects, and various relationships between domain objects
  • The relational database is represented as a table, and the reference relationship between the table and the table 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324612618&siteId=291194637