Skip to content

Commit 23af67c

Browse files
committed
docs: property, prototype, proxy diagrams
1 parent 3abaa83 commit 23af67c

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

Diff for: property/README.md

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

3232
> Define and manage a dynamic set of properties for an object, allowing customization without altering its structure.
3333
34+
Sequence diagram
35+
36+
![Property sequence diagram](./etc/property-sequence-diagram.png)
37+
3438
## Programmatic Example of Property Pattern in Java
3539

3640
The Property design pattern, also known as Prototype inheritance, is a pattern that allows objects to be created from other objects, forming object hierarchies. This pattern is particularly useful when you want to create a new object that is a slight variation of an existing object.

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

39 KB
Loading

Diff for: prototype/README.md

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

3636
> The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects.
3737
38+
Sequence diagram
39+
40+
![Prototype sequence diagram](./etc/prototype-sequence-diagram.png)
41+
3842
## Programmatic Example of Prototype Pattern in Java
3943

4044
In Java, the prototype pattern is recommended to be implemented as follows. First, create an interface with a method for cloning objects. In this example, `Prototype` interface accomplishes this with its `copy` method.

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

24.5 KB
Loading

Diff for: proxy/README.md

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

3737
> A proxy, in its most general form, is a class functioning as an interface to something else. A proxy is a wrapper or agent object that is being called by the client to access the real serving object behind the scenes. Use of the proxy can simply be forwarding to the real object, or can provide additional logic. In the proxy extra functionality can be provided, for example caching when operations on the real object are resource intensive, or checking preconditions before operations on the real object are invoked.
3838
39+
Sequence diagram
40+
41+
![Proxy sequence diagram](./etc/proxy-sequence-diagram.png)
42+
3943
## Programmatic Example of Proxy Pattern in Java
4044

4145
Imagine a tower where the local wizards go to study their spells. The ivory tower can only be accessed through a proxy which ensures that only the first three wizards can enter. Here the proxy represents the functionality of the tower and adds access control to it.

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

24.6 KB
Loading

0 commit comments

Comments
 (0)