docs: diagrams for serialized entity and serialized lob

This commit is contained in:
Ilkka Seppälä
2025-04-10 20:20:47 +03:00
parent a97bfec0a7
commit 30d6875aa1
4 changed files with 8 additions and 0 deletions
+4
View File
@@ -32,6 +32,10 @@ Wikipedia says
> In computing, serialization is the process of translating a data structure or object state into a format that can be stored (e.g. files in secondary storage devices, data buffers in primary storage devices) or transmitted (e.g. data streams over computer networks) and reconstructed later (possibly in a different computer environment). When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of objects does not include any of their associated methods with which they were previously linked.
Flowchart
![Serialized Entity flowchart](./etc/serialized-entity-flowchart.png)
## Programmatic Example of Serialized Entity Pattern in Java
The Serialized Entity design pattern is a way to easily persist Java objects to the database. It uses the `Serializable` interface and the DAO (Data Access Object) pattern. The pattern first uses `Serializable` to convert a Java object into a set of bytes, then it uses the DAO pattern to store this set of bytes as a BLOB (Binary Large OBject) in the database.
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

+4
View File
@@ -30,6 +30,10 @@ In plain words
> The Serialized LOB design pattern manages the storage of large objects, such as files or multimedia, by serializing and storing them directly within a database.
Flowchart
![Serialized LOB flowchart](./etc/serialized-lob-flowchart.png)
## Programmatic Example of Serialized LOB Pattern in Java
The Serialized Large Object (LOB) design pattern is a way to handle large objects in a database. It involves serializing an object graph into a single large object (a BLOB or CLOB, for Binary Large Object or Character Large Object, respectively) and storing it in the database. When the object graph needs to be retrieved, it is read from the database and deserialized back into the original object graph.
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB