mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 18:15:41 +00:00
Added Object Pool description to README.md.
This commit is contained in:
1 parent
d7c5683e3b
commit
190894936f
1 file changed
+10
@@ -25,6 +25,7 @@ Creational design patterns abstract the instantiation process. They help make a
|
|||||||
* [Property](#property)
|
* [Property](#property)
|
||||||
* [Singleton](#singleton)
|
* [Singleton](#singleton)
|
||||||
* [Multiton](#multiton)
|
* [Multiton](#multiton)
|
||||||
|
* [Object Pool](#object-pool)
|
||||||
|
|
||||||
### Structural Patterns
|
### Structural Patterns
|
||||||
|
|
||||||
@@ -619,6 +620,15 @@ validation and for building to order
|
|||||||
**Applicability:** Use the Private Class Data pattern when
|
**Applicability:** Use the Private Class Data pattern when
|
||||||
* You want to prevent write access to class data members
|
* You want to prevent write access to class data members
|
||||||
|
|
||||||
|
## <a name="object-pool">Object Pool</a> [↑](#list-of-design-patterns)
|
||||||
|
**Intent:** When objects are expensive to create and they are needed only for short periods of time it is advantageous to utilize the Object Pool pattern. The Object Pool provides a cache for instantiated objects tracking which ones are in use and which are available.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Applicability:** Use the Object Pool pattern when
|
||||||
|
* The objects are expensive to create (allocation cost)
|
||||||
|
* You need a large number of short-lived objects (memory fragmentation)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Frequently asked questions
|
# Frequently asked questions
|
||||||
|
|||||||
Reference in new issue
Block a user