Hello!

I'm quiet new to ojb and maybe haven't read all possible materials
about it. Excuse me if this is real newbie!!

Problem:

I have a library (university project) which has a COMPOSITE PATTERN
(the one from gamma et'al) for implementing the storing of
different types of objects (cds, books.... / catalogs and subcatalogs)
generic.

                        ---------------------  0..*  "has-a"
                        | InventoryEntry    |<--------------
                      |-------------------|                     |
                        | Operation()       |                   |
                        ---------------------                   |
                           ?                                    |
                                   |                                    |
                                   |    "i-as"                          |
                        --------------------                    |
                     |                    |                     |
                 |                    |                 |
         ----------------   -----------------------     |
         | Item         |   |   Catalog           |---
         ----------------   -----------------------
           |Operation() |   | Operation()               |
           ---------------    | Add(InentoryEntry)  |
                                    |Remove(InentoryEntry)|
                                    |---------------------|
                                    |Collection i_entries |
                            -----------------------

Item and Catalog have a "is-a" relationship with
Inventory Entry!
Catalog has a "has-a" relationship with Inventory
Entry.

Later in the implementation the Books and CDs should 
be derived from Item (for now it's sufficient to say
a book or what ever is an instance of Item).

So how to model this in the database and the repository
with storing instances of item and Catalog to the
same Collection (i_entries) in java.
(I do this by now having a Items Collection and a 
Catalog Collection in the Catalog Class. but these
two different Collections should be merged to one in java).

Besides this:
A Catalog can have null or many (sub)catalogs
and a Catalog can have null or many Items.
A Item can be in one or many (sub)Catalogs.

--> so I'm not only building a simple tree structure 
with this pattern, rather a more complex structure
with everything allowed than circular graphs
(because of then occurring endless loops traversing
the structure).

Excuse my bad English, but I haven't sleeped that much
last night!

Thanks
Georg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to