Tuesday, May 03, 2005

The Composite Pattern





The Design Patterns (Gang of Four) book explains the composite pattern. See Composite Pattern

One example of a composite pattern is a file in a filesystem/directory hierarchy. The figure below shows a probable implementation of a filesystem hierarchy using the composite pattern

class diagram

No comments:

Ranking and Unranking permutations

I've been a big fan of Skiena's Algorithm Design Manual , I recently found my first edition of the book (although I own the third ed...