Here is a scenario that could benefit from the
implementation of the pattern. This is, of course, implemented in VB.NET. In
almost all cases, the “Real Life Illustration” is different from the “Scenario
– Sample Code." Many readers will ask why. Well first of all, the Real
Life Illustration is easier to imagine since it relates to an everyday setting.
Also, the actors tend to have very separate roles and functions that clearly
mirror the way the classes in the pattern behave. Having come across it in
real life it allows for an easier mental adoption of the pattern. The code
scenario is better suited, however, to implementation in code without being too
unwieldy and hard to follow. In other words, it is more code friendly.
The other point is that the double-scenario approach gives
the reader a double dose of the pattern-thinking. Added to this is the
opportunity to explore the code-scenario and see how it follows from the
real-life scenario. In this way the reader gets the chance to double-check
their understanding of the pattern. Apart from the very
mathematical-theoretical aspects of computer science, Design Patterns is one of
the hardest topics and possibly the hardest topic that is required for every
general software developer. So be prepared to read many discussions and see
many applications of design patterns before they really sink in.