Composite Design Pattern

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Composite Design Pattern - Presentation Transcript

    1. Composite Design Pattern by: Dela Cruz, Evangelista, Felisco, Jumawan REFERENCE: http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-designpatterns.html http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-designpatterns.html
    2. Composite Objects
      • Objects that contain other objects
      • It compose objects into tree structures to represent part-whole hierarchies.
      • Example:
      • A drawing may be composed of graphic primitives, such as lines, circles, rectangles, text, and so on.
    3. Problems Resolved
      • It lets clients treat individual objects and compositions of objects uniformly.
      • We often must manipulate composites exactly the same way we manipulate primitive objects.
    4. Sample Code (Composite method)
      • public void draw() { // Iterate over the components for(int i=0; i < getComponentCount(); ++i) { // Obtain a reference to the component and invoke its draw method Component component = getComponent(i); component.draw(); } }
    SlideShare Zeitgeist 2009

    + Fridz FeliscoFridz Felisco Nominate

    custom

    293 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 293
      • 293 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories