mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-23 20:26:02 +00:00
docs: diagrams for transaction script, twin, and type object
This commit is contained in:
@@ -32,12 +32,16 @@ Real-world example
|
||||
|
||||
In plain words
|
||||
|
||||
> Explore how the Java Type Object pattern enables dynamic creation and management of flexible and extensible sets of related classes, ideal for Java developers seeking modularity without modifying existing codebase.
|
||||
> Type Object pattern enables dynamic creation and management of flexible and extensible sets of related classes, ideal for Java developers seeking modularity without modifying existing codebase.
|
||||
|
||||
gameprogrammingpatterns.com says
|
||||
|
||||
> Define a type object class and a typed object class. Each type object instance represents a different logical type. Each typed object stores a reference to the type object that describes its type.
|
||||
|
||||
Flowchart
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Type Object Pattern in Java
|
||||
|
||||
The Type Object pattern is a design pattern that allows for the creation of flexible and reusable objects by creating a class with a field that represents the 'type' of the object. This design pattern proves invaluable for scenarios where anticipated Java types are undefined upfront, or when modifications or additions are required, ensuring efficient Java development without frequent recompilations.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user