This Training is organized in six courses.
The Observer Pattern: Dynamics and Variations Explained
"Isn't it the Model-View-Control (MVC) Pattern?" "No!"
There is much, much more to it than that.
The basic dynamic of this pattern is extremely interesting. The message inversion mechanism that characterises this design pattern is so relevant that if taken to an extreme, it can lead to leaving the Object-Oriented Paradigm and entering the Event-Driven Paradigm.
In this course, Francesco Cirillo explores the basic dynamics of message inversion typical of this pattern. He begins by showing how to implement simple functional behaviours with this dynamic.
Francesco then addresses a number of significant variations of the pattern. Not only architectural variations are shown: for example MVC and Subscription-Publishing. He also shows the variations that make the pattern's dynamics useful for implementing and simplifying the development of complex functional behaviours.
The Observer Pattern TDD Practice
We need two projects to fully understand how to implement this design pattern.
The first project we apply a pattern to is the Calculator. This is the classic domain for applying Strategy or Commands. Is it possible to effectively implement the logic of a Calculator with the Observer pattern? The definition of effective we use is reducing the cost curve of change.
The second project is related to the Visicalc Challenge. One of the most useful functions of a spreadsheet is recalculation. Change the value of a cell and the whole sheet magically updates. Is it possible to apply the Observer pattern to solve this functionality? Or is this one of those cases where this pattern makes the system more complex? If so, what other patterns might be more effective in reducing the cost of change?
The Bridge Pattern: Dynamics and Variations Explained
"Isn't it an Adapter?" "NO!"
The Bridge pattern has the reputation of being a "difficult," unclear pattern. It is a somewhat obsolete "architectural" pattern to be used at a low level for the development of user interface components. The Bridge pattern is one of those 'mysterious' patterns, along with the Flyweight of the Gang of Four's 23 that developers never used. This pattern can actually be very effective for demultiplying the complexity of numerous user stories and not only for non-functional matters.
The first objective of this course is to clarify the dynamic difference between this pattern and other patterns such as the Adapter Pattern or the EnvelopeLetter or ShieldPattern idiom that are often confused with the Bridge. We then deal with variations of the Bridge pattern. Yes, there are quite a few. And often the variations coincide with different applications.
The Bridge Pattern: TDD Practice
The Bridge Pattern requires development to be understood.
We apply the Bridge Pattern to develop a... Video Game!
And let me be clear: we do not apply it to solve the low-level user interface or some kind of platform issue. We use the Bridge Pattern to solve and implement a functional issue related to a certain Video Game.
The Prototype Pattern: Dynamics and Variations Explained
"Isn't it to clone objects?" "Well, it’s not only for that!"
The Prototype pattern is another little known and used pattern. Those who know a little more about design patterns apply it to clone objects.
The first thing we study is the dynamics of this pattern. This allows us to consider interesting variations of this pattern.
The Prototype Pattern: TDD Practice
"How about Self?""
When I had to think about an application of this pattern, I had no doubts.
How can we implement some behaviour to develop a mini-Self language by applying the Prototype pattern?
And maybe build a simple video game?