The first week of my final semester of grad school is in the bag. This go-round is all about software design, both low-level (“RSEG 109: Object-Oriented Design“) and high-level (“RSEG 290: Special Topics: Design Patterns”). When you add in the reading group we’re starting at work, this could also be called the “UML semester.”
Design patterns give a shared vocabulary for talking about common software design features, present how and when to use a design, and lay out the trade-offs of using a particular design. They aren’t as widely used as they should be in a profession that claims to value reuse. I think that’s a shame.
As part of the design patterns course, I must create an object model for a real-world problem. And along the way, I’ll be learning about most of the two-dozen OO design patterns in the Gang Of Four book. (Usually I don’t present solutions to my homework in public because I feel it could help the next semesters’ students cheat; but this semester we’re each doing our own thing.)
Since I’m learning about them, I’ll do my best to write about them over the coming weeks. If all goes well, I’ll have an outlet to reinforce what I’m learning; and you, my dear readers, will have a gentle on-ramp to design patterns, too.
Here’s the description I submitted last night of the software system I will design:
I will apply design patterns to a simplified web content management system, colloquially known as a “blog.”
While blogs frequently are vehicles for cute kitty photos, angst-filled teen poetry, and ill-informed political shouting, this CMS will not know anything special about its content. Here’s what users will be able to do with it:
- The blog author(s) will be able to write new articles and edit them before publishing.
- Authors will be able to preview articles before publishing.
- Authors will be able to post articles and have them appear on the web.
- Authors will be able to edit articles after they are published.
- The blog’s readers — supposing there are any — will be able to post comments in response to articles.
- The CMS software will display the following elements: static text, linked images, embedded objects, and dynamically generated content.
- Authors can activate/deactivate “plugins” that implement a well-defined API.
- Authors will be able to change the appearance of the blog by selecting from an arbitrary set of “themes.”
- Readers will be able to display single articles or an archive of articles showing a full month of articles.
- Readers can navigate from one article (or set of articles) to the prior or next article (or set of articles).
- The author can choose whether the CMS stores articles in a database or in a flat-text file.
So keep tuning in, and we’ll take a tour through design patterns for object-oriented software reuse. And please post comments about where you’ve been able to use design patterns successfully, if you see anything you would have done differently, or if you just want to leave your two cents.