Structure of Design Patterns
page 6 of 9
by David Simmonds
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32979/ 82

Scenario - Sample Code

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.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-27 9:31:39 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search