XML Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)
Design patterns and XML
The whole notion of "design patterns" has become something of a buzzword in numerous programming and markup languages nowadays. That's why I wasn't surprised to read about -- but also felt impelled to comment on -- the appearance of a story in this week's XML.com newsletter entitled "W3C XML Schema Design Patterns: Dealing with Change," by Dare Obasanjo.
To begin with, the notion of design patterns traces its way back into the field of architecture, and derives largely from the work of Christopher Alexander and a group of talented colleagues who published a series of influential books in the late 1970s. The first book in that series (originally published in 1979) is entitled The Timeless Way of Building (Oxford University Press, ISBN: 0-19-502402-8). It introduces the concept of a design pattern which is initially explained as "... every building, every town, is made of up of certain entities which I call patterns; and once we understand buildings in terms of their patterns, we have a way of looking at them, which makes all buildings, all parts of a town similar, all members of the same class of physical structures" (p. 11). Other books followed discussing design patterns in architecture.
The book that registered design patterns for most people who work with software, however, was Design Patterns: Elements of Reusable Object-Oriented Software, by Gamma Erich, Richard Helm, Ralph Johnson, and John Vlissides. Until I read this book, I -- like many other people who work in the computer business -- had never heard of Alexander's work, nor did I appreciate the expressive power and utility of design patterns, per se.
Thus, my initial response in reading Obasanjo's article was "XSLT hasn't been around long enough for real design patterns to emerge just yet." But upon further reading, I was struck by the types of problems to which he applies this notion -- and indeed, there is some viable transfer of ideas from other design patterns books to the topics he mentions in his story. In particular, his discussion of the use of wildcards and namespaces to ensure open-ended, highly flexible schema designs is well-founded and equally well-stated. His discussion of multiple forms for subtypes (aka subtype polymorphism in Design Patterns) is likewise appropriate.
But one should beware of applying design patterns for which there is no prior precedent in relatively young areas of markup or programming languages, simply because it takes time for the redesign and recoding work that lets true design patterns emerge from the welter of details that go into schemas in particular or XML applications in general. That's why it's important to ponder suggested design patterns and consider their antecedents carefully before adopting them on somebody else's say-so. That's why I also recommend the Alexander and Erich books to anybody who's really serious about understanding and applying this fascinating and useful notion to their XML efforts.
About the Author
Ed Tittel is a principal at LANWrights, Inc., a network-oriented writing, training, and consulting firm based in Austin, Texas. He is the creator of the Exam Cram series and has worked on over 30 certification-related books on Microsoft, Novell, and Sun related topics. Ed teaches in the Certified Webmaster Program at Austin Community College and consults. He a member of the NetWorld + Interop faculty, where he specializes in Windows 2000 related courses and presentations.
For More Information:
- Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
- Are you tired of technospeak? The Web Services Advisor column uses plain talk without the hype.
- For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
- Hey Codeheads! Start benefiting from other time-saving XML Developer Tips and .NET Developer Tips.
- Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
- Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest lingo.
- Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
- Discuss this issue, voice your opinion or just talk with your peers in the SearchWebServices Discussion Forums.