2009 Composite

2009 Composite - compositions of objects uniformly Fall...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 2009 ACS-3913 Ron McFadyen Composite Pattern Problem: How do we treat a composition structure of objects the same way as a non-composite object? Arises in POS because there may be multiple co-existing pricing strategies, and we prefer if Sale does not know if there’s one or many Solution: define classes for a composite structure A composite is a group of objects in which some objects contain others; one object may represent groups, and another may represent an individual item, a leaf.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fall 2009 ACS-3913 Ron McFadyen Composite Used to compose objects into tree structures to represent part- whole hierarchies Composite lets clients treat individual objects and 
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: compositions of objects uniformly Fall 2009 ACS-3913 Ron McFadyen Composite Component declares the interface for objects implements default behavior Leaf represents leaf objects in the composition. has no children. defines behavior for primitive objects in the composition. Composite defines behavior for components with children stores child components implements child-related operations Client manipulates objects using the interface Fall 2009 ACS-3913 Ron McFadyen Composite Pattern Consider figures 26.14, 26.15 on page 454-5...
View Full Document

This note was uploaded on 02/17/2010 for the course ACS ACS-3911 taught by Professor Chen during the Spring '10 term at Windsor.

Page1 / 4

2009 Composite - compositions of objects uniformly Fall...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online