learn to work in the system, by which I mean that everybody, every team, every pla=orm, every division, every component is there not for individual compe@@ve profit or recogni@on, but for contribu@on to the system as a whole on a win-‐win basis.” W. Edwards Deming -‐ Na2onal Medal of Technology 1987 Blog: betweenthebraces.com Twi*er: @ricky_clegg Email: [email protected]
Pa.erns group. This includes pa.erns such as Decorator and Adapter • Structural pa.erns are strategies that use classes and objects to build up larger structures. This mainly entails the use of abstract classes and interfaces.
pa.ern provides a robust solu@on to building complex systems that are made up of several smaller components. The components that make up the system may be individual objects or containers that represent collec@ons of objects. • Think of a car as a complex system that is made p of several smaller components. The car contains an engine, body, chassis, seats, @res, etc.
is a composite object. It contains several smaller parts @re, rim, hubcaps. • The thing that makes it special is that the client has no need to know about all the parts of a composite object. It can simply call one opera@on and the composite object will call the same method on all it’s children to make them operate.
The pa.ern is made up of branches and leaves. • A object that has children is referred to as a composite node. An object with no children is called a leaf node. • The trunk of the tree (client) does not need to know about the leaves or if the branches have more branches. When .sway() is called each composite object will call .sway() on every branch and leaf.
class is a composite node. A Song is a leaf node. • A MusicPlaylist can contain Songs and other MusicPlaylists. • The opera@on they all share is ‘play()’ and can be built of an IMusic to enforce the contract. And a Music abstract class to build default func@onality. • The clients has no idea about how many songs there are, or how to play them. Calling myRnBPlaylist.play() will handle all subsequent opera@ons.
of a children's mobile which is a composite node, it will call the touch() opera@on. This will cascade the touch() opera@on on only the children of that object.