Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 2 - Jonathan Reitnauer
Question 1: How does choice of language affect the use of design patterns?
In the article “A debate on language and tool support for design patterns,” the authors discuss the ideas of what design pattern features should be built into programming languages themselves and how different languages could approach this area distinctly. They make the point that given the increased popularity of design patterns in recent years, it might be a good idea to incorporate useful patterns directly into programming languages, thus making them easier to utilize.
The article mentions that some people see this as a logical next step because of the fact that some patterns are designed to be used in specific, common languages, such as C++ or Java. This approach does present some problems however, such as what considerations should be applied to determine the patterns that should be supported. The authors advocate a middle ground. They suggest that language designers should study design patterns and use that knowledge to figure out to what extent features related to them can be included in the language.
This idea makes sense because since every language is different, the extent to which complex additions such as design patterns should be incorporated could depend on the goal and function of the particular language under development. Having a good working knowledge of design patterns will enable the language writer to better understand how the language can be structured to allow programmers to more easily implement these patterns without needlessly complicating the structure of the language.
Question 2: Describe an Interesting Pattern
One useful pattern in designing software controllers for various systems is the Command pattern. This is a method of encapsulating a command to some component of the system as an object that can be sent or passed around in the system. In this pattern, the sender of a command will have a reference to the command object and will call a method in that object to execute the command and perform whatever action is necessary.
This pattern has several useful features. One is that it can easily support undo and redo functions by simply building a list or array structure of command objects. Using the Command pattern also makes it simple to group commands into sets containing multiple related actions. These so called “meta-commands” can then be executed by just calling one method in a meta-command object.
A Debate on Language and Tool Support for Design Patterns
Craig Chambers, Bill Harrison, and John Vlissides
Annual Symposium on Principles of Programming Languages
Boston, MA: 2000
Command Design Pattern
Link to this Page