Skip to content

Commit a7f47d1

Browse files
committed
update readme.md
1 parent 25ed31b commit a7f47d1

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
1-
# DesignPatternsJava9
2-
This repo consists Gang of Four Design patterns code on Java 9. Each branch in the repository has code of 1 design pattern. Switch repository to try out different design patterns.
1+
# What is Composite Design Pattern
2+
* Composite pattern composes objects in term of a tree structure to represent part as well as whole hierarchy.
3+
* This pattern creates a class that contains group of its own objects.
4+
5+
## Diagram
6+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/composite-pattern/diagrams/Composite%20Design%20Pattern%20class%20diagram.png "Diagram")
7+
8+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/composite-pattern/diagrams/Composite%20design%20pattern%20tree%20example.png "Diagram")
9+
10+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/composite-pattern/diagrams/composite%20sequence%20diagram.png "Diagram")
11+
12+
### When to use Composite Design Pattern
13+
Composite Pattern should be used when clients need to ignore the difference between compositions of objects and individual objects and needs to handles them in the same way.
14+
15+
### The Composite Pattern has four participants:
16+
* Component – Component declares the interface for objects in the composition and for accessing and managing its child components. It also implements default behavior for the interface common to all classes as appropriate.
17+
* Leaf – Leaf defines behavior for primitive objects in the composition. It represents leaf objects in the composition.
18+
* Composite – Composite stores child components and implements child related operations in the component interface.
19+
* Client – Client manipulates the objects in the composition through the component interface.
20+
21+
### Learn Design Patterns with Java by Aseem Jain
22+
This repository contains working project code used in video Course by Packt Publication with title "Learn Design Patterns with Java " authored by "Aseem Jain".
23+
24+
### Course link:
25+
https://www.packtpub.com/application-development/learn-design-patterns-java-9-video
26+
27+
### ![ http://in.linkedin.com/in/premaseem](https://github.com/premaseem/DesignPatternsJava9/blob/master/linkedin.png "http://in.linkedin.com/in/premaseem") Profile: http://in.linkedin.com/in/premaseem
28+
29+
### Authors blog on design patterns:
30+
https://premaseem.wordpress.com/category/computers/design-patterns/
31+
32+
### Software Design pattern community face book page:
33+
https://www.facebook.com/DesignPatternGuru/
34+
35+
### Note:
36+
* This code base will work on Java 9 and above versions.
37+
* `diagrams` folders carry UML diagrams.
38+
* `pattern` folder has code of primary example.
39+
* `patternBonus` folder has code of secondary or bonus example.

0 commit comments

Comments
 (0)