Skip to content

Commit 8e82390

Browse files
committed
docs: single table inheritance and singleton diagrams
1 parent e5485da commit 8e82390

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

Diff for: single-table-inheritance/README.md

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

3737
> Single table inheritance is a way to emulate object-oriented inheritance in a relational database. When mapping from a database table to an object in an object-oriented language, a field in the database identifies what class in the hierarchy the object belongs to. All fields of all the classes are stored in the same table, hence the name "Single Table Inheritance".
3838
39+
Flowchart
40+
41+
![Single Table Inheritance flowchart](./etc/single-table-inheritance-flowchart.png)
42+
3943
## Programmatic Example of Single Table Inheritance Pattern in Java
4044

4145
Single Table Inheritance is a design pattern that maps an inheritance hierarchy of classes to a single database table. Each row in the table represents an instance of a class in the hierarchy. A special discriminator column is used to identify the class to which each row belongs.
Loading

Diff for: singleton/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Wikipedia says
3333

3434
> In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.
3535
36+
Sequence diagram
37+
38+
![Singleton Pattern sequence diagram](./etc/singleton-sequence-diagram.png)
39+
3640
## Programmatic Example of Singleton Pattern in Java
3741

3842
Joshua Bloch, Effective Java 2nd Edition p.18

Diff for: singleton/etc/singleton-sequence-diagram.png

51.8 KB
Loading

0 commit comments

Comments
 (0)