Inhoud
Design patterns - Introductie ........................................................................................................................... 4
Patronen ....................................................................................................................................................... 4
Architectural patterns .................................................................................................................................. 4
Design patterns ............................................................................................................................................ 5
Definitie design pattern ........................................................................................................................... 5
Type designpatterns ................................................................................................................................. 6
OO basis ....................................................................................................................................................... 7
Generalisatie ............................................................................................................................................ 7
Associatie ................................................................................................................................................. 7
aggregatie / compositie ........................................................................................................................... 7
Polyporphism ........................................................................................................................................... 7
Decompositie in de OO wereld .................................................................................................................... 8
Inkapseling ............................................................................................................................................... 8
Modularisatie ........................................................................................................................................... 8
Lage Koppeling en Hoge cohesie.............................................................................................................. 8
Strategy OO Pattern ..................................................................................................................................... 9
Design principles ...................................................................................................................................... 9
Design Principles ..................................................................................................................................... 10
“Identify the aspect that vary and separate them from what stays the same” .................................... 10
“program to an interface, not an implementation” .............................................................................. 10
“favor composition over inheritance” (“favor association over inheritance”) ...................................... 10
“strive for loosely coupled designs between objects that interact” ..................................................... 10
“classes should be open for extension, but closed for modification” ................................................... 11
“depend upon abstractions, do not depend upon concrete classes” ................................................... 11
“a class should only have one reason to change” (single responsibility) ........................................... 11
Association, aggregation and composition ................................................................................................ 12
Singleton......................................................................................................................................................... 13
Probleemdefinitie: ................................................................................................................................. 13
Voor- en nadelen ........................................................................................................................................ 13
Voordelen ............................................................................................................................................... 13
Nadelen .................................................................................................................................................. 13