Skip to content

Commit b6c13a2

Browse files
committed
docs: add diagrams for dao, data bus, data locality, data mapper, dto
1 parent 0509fab commit b6c13a2

File tree

11 files changed

+24
-0
lines changed

11 files changed

+24
-0
lines changed

data-access-object/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Wikipedia says
3636

3737
> In computer software, a data access object (DAO) is a pattern that provides an abstract interface to some type of database or other persistence mechanism.
3838
39+
Sequence diagram
40+
41+
![Data Access Object sequence diagram](./etc/dao-sequence-diagram.png)
42+
3943
## Programmatic Example of DAO Pattern in Java
4044

4145
There's a set of customers that need to be persisted to database. Additionally, we need the whole set of CRUD (create/read/update/delete) operations, so we can operate on customers easily.
54.2 KB
Loading

data-bus/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ In plain words
3131

3232
> Data Bus is a design pattern that connects components of an application for communication based on the type of message or event being transferred. This pattern promotes decoupling, making it easier to scale and maintain the system by allowing components to communicate without direct dependencies.
3333
34+
Sequence diagram
35+
36+
![Data Bus Sequence Diagram](./etc/data-bus-sequence-diagram.png)
37+
3438
## Programmatic Example of Data Bus Pattern in Java
3539

3640
Say you have an app that enables online bookings and participation in events. You want the app to send notifications, such as event advertisements, to all ordinary members of the community or organization holding the events. However, you do not want to send such advertisements to event administrators or organizers. Instead, you want to send them notifications about the timing of new advertisements sent to all members. The Data Bus enables you to selectively notify community members by type (ordinary members or event administrators) by making their classes or components only accept messages of a certain type. Thus, ordinary members and administrators do not need to know about each other or the specific classes or components used to notify the entire community, except for knowing the type of messages being sent.
49.8 KB
Loading

data-locality/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ In plain words
3131

3232
> The Data Locality pattern organizes data in memory to reduce access times and improve performance by ensuring that data frequently accessed together is stored close together. This is crucial for high-performance applications like game engines and real-time data processing systems.
3333
34+
Mind map
35+
36+
![Data Locality mind map](./etc/data-locality-mind-map.png)
37+
38+
Flowchart
39+
40+
![Data Locality flowchart](./etc/data-locality-flowchart.png)
41+
3442
## Programmatic Example of Data Locality Pattern in Java
3543

3644
The Data Locality pattern is a design pattern that aims to improve performance by arranging data in memory to take advantage of spatial locality. This pattern is particularly useful in high-performance computing and game development where access speed is crucial.
85.9 KB
Loading
211 KB
Loading

data-mapper/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Wikipedia says
3434

3535
> A Data Mapper is a Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in-memory data representation (the domain layer). The goal of the pattern is to keep the in-memory representation and the persistent data store independent of each other and the data mapper itself. This is useful when one needs to model and enforce strict business processes on the data in the domain layer that do not map neatly to the persistent data store.
3636
37+
Sequence diagram
38+
39+
![Data Mapper sequence diagram](./etc/data-mapper-sequence-diagram.png)
40+
3741
## Programmatic Example of Data Mapper Pattern in Java
3842

3943
The Data Mapper is a design pattern that separates the in-memory objects from the database. Its responsibility is to transfer data between the two and also to isolate them from each other. This pattern promotes the [Single Responsibility Principle](https://java-design-patterns.com/principles/#single-responsibility-principle) and [Separation of Concerns](https://java-design-patterns.com/principles/#separation-of-concerns).
73.6 KB
Loading

data-transfer-object/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ Wikipedia says
3535

3636
> In the field of programming a data transfer object (DTO) is an object that carries data between processes. The motivation for its use is that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation. Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only.
3737
38+
Sequence diagram
39+
40+
![Data Transfer Object sequence diagram](./etc/dto-sequence-diagram.png)
41+
3842
## Programmatic Example of DTO Pattern in Java
3943

4044
Let's first introduce our simple `CustomerDTO` record.
Loading

0 commit comments

Comments
 (0)