Summary


The Composite pattern is an important pattern for creating hierarchical structures in which you want to be able to treat all the elements in the same way. This chapter uses a file system example composed of files and directories to illustrate one case in which the Composite pattern can be useful. In this example, files and directories implement the same interface, which is a key feature of the Composite pattern. By implementing the same interface, you can treat files and directories in exactly the same way, and you can store either a file or a directory as a child of a directory.




Advanced ActionScript 3 with Design Patterns
Advanced ActionScript 3 with Design Patterns
ISBN: 0321426568
EAN: 2147483647
Year: 2004
Pages: 132

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net