You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: abstract-document/README.md
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,11 @@ Wikipedia says
33
33
34
34
> An object-oriented structural design pattern for organizing objects in loosely typed key-value stores and exposing the data using typed views. The purpose of the pattern is to achieve a high degree of flexibility between components in a strongly typed language where new properties can be added to the object-tree on the fly, without losing the support of type-safety. The pattern makes use of traits to separate different properties of a class into different interfaces.
35
35
36
+
Class diagram
37
+
38
+

39
+
40
+
36
41
## Programmatic Example of Abstract Document Pattern in Java
37
42
38
43
Consider a car that consists of multiple parts. However, we don't know if the specific car really has all the parts, or just some of them. Our cars are dynamic and extremely flexible.
@@ -119,6 +124,13 @@ public interface HasParts extends Document {
07:21:57.395 [main] INFO com.iluwatar.abstractdocument.App -- door/Lambo/300
180
192
```
181
193
182
-
## Abstract Document Pattern Class Diagram
183
-
184
-

185
-
186
194
## When to Use the Abstract Document Pattern in Java
187
195
188
196
The Abstract Document design pattern is especially beneficial in scenarios requiring management of different document types in Java that share some common attributes or behaviors, but also have unique attributes or behaviors specific to their individual types. Here are some scenarios where the Abstract Document design pattern can be applicable:
0 commit comments