Domain helps upport the process of improving or automating the business process.
A domain can be separated into a lower level domain to link to other lower level domains to provide the entire process.
The domain model refers to the process or map that includes the useful characteristic. The domain model is a model that conceptually orders a certain domain.
Types of domain modeling:
1. Entity (엔티티)
userId
of the User
class)The architecture pattern is the most fundamental foundation to structure a software.
The architecture pattern defines each system and its function.
Top architecture patterns:
Things to consider before introducing an architecture pattern:
1. There must be a clear reason as to the benefits and costs of the architecture pattern
2. Clearly understand what pros and cons exist for an architecture pattern
3. Introduce an architecture pattern if the application and domain are too complicated enough to justify the effort and time invested in adding several classes
One of the most common architecture pattern that separates into layers.
It is simple, popular, and comparatively costless and is pretty much the standard architecture.
The pattern is to separate and maintain in layers and the goal is for every layer to only depend on the layer below it.
The key of layering is to have high cohesion (응집도) and have low coupling (결합도).
You can design a upper and lower layer but the lower layer cannot know what its upper layer or use the upper layer.
Pros of the layered architecture pattern:
The three layers of the 3-layered architecture is as follows:
1. Presentation layer (프레젠테이션 계층)
2. Business logic layer (비즈니스 로직 계층)
3. Data access layer (데이터 엑세스 계층)
The 3-layered architecture uses the following three processes:
1. Controller (in presentation layer): Is the outermost part of an application and processes requests and responses.
2. Service (in business logic layer): The middle part of the application where actual important processes usually take place. This is where the key part of the architecture, business logic, runs. It makes a request to the repository if data from the DB is required.
3. Repository (in data access layer): The innermost part of the application that connects to the DB. This is where the data from the actual DB is used, including managing DB and DB CRUD processes.
Process flow:
1. The client makes a rquest
2. The controller receives the request according to its URL.
3. The controller calls the service to process the request.
4. The service requests data from the repository to get the required data.
5. The service processes the data from the repository, then sends the data to the controller.
6. The controller sents the resulting response from the service to the client.