You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,7 +360,45 @@ obj2.hashCode(). Two unequal objects MIGHT have the same hashCode.
360
360
- TODO
361
361
362
362
##Examples of Design Patterns used in Java
363
-
- TODO
363
+
364
+
###Some Creational patterns
365
+
- Factory method
366
+
- java.util.Calendar#getInstance()
367
+
- java.nio.charset.Charset#forName()
368
+
- Prototype
369
+
- java.lang.Object#clone()
370
+
- Singleton
371
+
- java.lang.Runtime#getRuntime()
372
+
- java.lang.System#getSecurityManager()
373
+
374
+
###Some Structural patterns
375
+
- Adapter
376
+
- java.util.Arrays#asList()
377
+
- javax.xml.bind.annotation.adapters.XmlAdapter#marshal() and #unmarshal()
378
+
379
+
- Decorator
380
+
- All subclasses of java.io.InputStream, OutputStream etc.
381
+
- java.util.Collections : synchronizedXXX() and unmodifiableXXX() methods.
382
+
383
+
- Flyweight
384
+
- java.lang.Integer#valueOf(int) (also on other Wrapper classes)
385
+
386
+
###Behavioral patterns
387
+
- Chain of responsibility
388
+
- javax.servlet.Filter#doFilter()
389
+
- Exception Handling
390
+
391
+
- Command
392
+
- java.lang.Runnable
393
+
394
+
- Iterator
395
+
- All implementations of java.util.Iterator
396
+
397
+
- Strategy (recognizeable by behavioral methods in an abstract/interface type which invokes a method in an implementation of a different abstract/interface type which has been passed-in as method argument into the strategy implementation)
398
+
- java.util.Comparator#compare(), executed by among others Collections#sort().
399
+
400
+
- Template method (recognizeable by behavioral methods which already have a "default" behaviour definied by an abstract type)
401
+
- All non-abstract methods of java.util.AbstractList, java.util.AbstractSet and java.util.AbstractMap.
0 commit comments