View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 2 - Jiasheng He

1. Describe the Portland Form. Why it is useful?

The Portland Form is a method of writing about a set of Design Patterns. Design Patterns are context, problem, and solution sets that identify a problem and introduce a method or practice in order to solve it. They are useful so that we can avoid common and not so common pitfalls that come up and follow a guide to overcome them, without directly having to reinvent the wheel.
The Portland Form itself is the explanations of the Design Patterns written as a narrative. It shares several similarities to the Alexanderian Form, particularly in its use of "Therefore" to separate the problem and the solution points. The complete Pattern Paragraph format first states the problem in the context of when it would occur. The problem statement is directly followed by a "Therefore: " and then the solution.
What makes the Portland Form unique and useful is the fact that it groups several Design Patterns together; as Ward Cunningham states, "a system of patterns that work together." They are put together in one document so that the patterns can be understood as a whole, as a language of sorts. The author should start off with a Summary/Introduction Section that describes how these patterns are going to tackle different problem aspects of some topic and how the patterns relate together.


2. Describe one design pattern or pattern language in your own words.

The Strategy Pattern
The Strategy Pattern allows for usage of different algorithms for varying situations. The pattern allows for the definition of a family of algorithms, each encapsulated as an object. By using the Strategy Pattern, the algorithms become switchable with each other at run-time.
To implement the Strategy Pattern, a foundation class, in the form of an abstract Strategy class, needs to be declared first. Each algorithm is employed in its own object class that is derived from this abstract class. The user can then instantiate the Strategy class in their code, and use whatever strategy functions that he or she needs.
The Strategy Pattern is already widely used: one example is the way Java handles Layouts. The main advantage of the pattern is that it allows for use of multiple similar algorithms or multiple classes with similar behavior. As such, I could definitely see myself using this pattern for algorithms that differ only slightly, but are all needed as solutions. Bob Tarr mentions using it to differentiate methods for validating GUI input (for dealing with alphabetic, numeric, alphanumeric, etc), which is an example of something that will potentially be needed in this class and in the future.


Links to this Page