skip to Main Content

Welcome

Say hello to the toggle bar. This is an optional section you can use to display any content you'd like. Simply select a page from the theme panel and the content of the page will display here. You can even use the drag and drop builder to create this! This is a perfect place for your company mission statement, alerts, notices or anything else.

Get In Touch

Email: support@total.com
Phone: 1-800-Total-Theme
Address: Las Vegas, Nevada

Our Location

togglebar-map

Composite Pattern

Post Series: Structual Design Pattern

Composite pattern is used to separate an abstraction from its implementation (a group of objects and a single object) so that both can be modified independently.

Component: This is an abstract class containing members that will be implemented by all object in the hierarchy. It acts as the base class for all the objects within the hierarchy
Composite: This is a class which includes Add,Remove,Find and Get methods to do operations on child components.
Leaf: This is a class which is used to define leaf components within the tree structure means these cannot have children.

Implement

Usage

  1. Hierarchical representations of objects are required.
  2. A single object and a group of objects should be treated in the same way.
  3. The Composite pattern is used when data is organized in a tree structure (for example directories in a computer).

Resource

http://www.dotnettricks.com/learn/designpatterns/composite-design-pattern-dotnet

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top