[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kuml-devel
Subject:    Re: Creation of drawing items
From:       Jake Fear <fear () dtai ! com>
Date:       1999-12-30 18:22:58
[Download RAW message or body]

Creation of DrawingItems could also be handled by a concrete visitor
class. 

class DrawingItemCreator : public Visitor {

public:
    void accept(Classes* c) {
        item = new DrawingClass(c);
    }

    // One for each type in overview tree....


    DrawingItem* getDrawingItem() {
       return item;
    }
};

Again, rather than using the "getObjectTypeAsString()" member I think it
would be better to take advantage of polymorphic behavior.

Cheers    

Darius Stachow wrote:
> 
> Hi !
> 
> I've thought on how the drawing items should be created.
> As we already have a clone() and getObjectTypeAsString() method for all items
> it's a good idea to use the prototype pattern for creating.
> 
> I want to add a factory method to the diagram that will do the creation by
> looking for a prototype.
> So the creation of views would be coupled to diagrams.
> 
> Comments ?
> 
> --
> Open your mind ...
> Darius Stachow

-- 
|-------------------------------------------------------------------
| Jake Fear
| DTAI, Incorporated - http://www.dtai.com
| mailto:fear@dtai.com
| Office:(619)542-1700 x227   -   Fax:(619)542-8675
|-------------------------------------------------------------------
    carpe diem

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic