0
kicks
Design Patterns – Using the Composite Pattern in C#
Composite Pattern enables a client to treat a single entity and a collection of entities in the same way. Frequently, developers create systems in which a component may be an object or a collection of objects. For example, an application that gathers metrics on the size of the files/folders in a file system would like to treat the folder and the file in the same way. A folder is either empty or composed of one or more files. The size of a folder is the size of the individual files that make the folder and the size of the file is the size of that individual file itself. The Composite Pattern is designed to accommodate such a requirement.