Added code comments for Multiton.

This commit is contained in:
Ilkka Seppala
2015-05-16 00:27:06 +03:00
parent f2457699b0
commit d0c32782ce
3 changed files with 23 additions and 0 deletions
@@ -1,5 +1,17 @@
package com.iluwatar;
/**
*
* Whereas Singleton design pattern introduces single globally
* accessible object the Multiton pattern defines many globally
* accessible objects. The client asks for the correct instance
* from the Multiton by passing an enumeration as parameter.
*
* In this example Nazgul is the Multiton and we can ask single
* Nazgul from it using NazgulName. The Nazguls are statically
* initialized and stored in concurrent hash map.
*
*/
public class App {
public static void main( String[] args ) {