added Property pattern

This commit is contained in:
vehpsr
2015-03-29 23:03:06 +03:00
parent eddf2e630f
commit d57da2593b
10 changed files with 303 additions and 3 deletions

View File

@ -15,8 +15,9 @@ Creational design patterns abstract the instantiation process. They help make a
* [Builder](#builder)
* [Factory Method](#factory-method)
* [Prototype](#prototype)
* [Property](#property)
* [Singleton](#singleton)
### Structural Patterns
Structural patterns are concerned with how classes and objects are composed to form larger structures.
@ -433,6 +434,17 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi
**Applicability:** Use the Execute Around idiom when
* You use an API that requires methods to be called in pairs such as open/close or allocate/deallocate.
## <a name="property">Property</a> [&#8593;](#list-of-design-patterns)
**Intent:** Create hierarchy of objects and new objects using already existing objects as parents.
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/property/etc/property.jpg "Property")
**Applicability:** Use the Property pattern when
* when you like to have objects with dynamic set of fields and prototype inheritance
**Real world examples:**
* [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) prototype inheritance
# Frequently asked questions
**<a id="Q1">Q: What is the difference between State and Strategy patterns?</a>**