I'm attempting to model a grocery store. In the store, there are several "aisles". Each "aisle" has a group of "categories" of "items" it stores. Each "category" can only belong to one "aisle". Each "item" can only have one "category".
The data model seems straight forward to me:
- An "aisle" table with an ID and DESCRIPTION
- A "category" table with an ID, NAME and an AISLE_ID that refernces the "aisle" table
- An "item" table with an ID, NAME, DESCRIPTION and a CATEGORY_ID that references "category"
The object model is where I need help:
- An Aisle object can have a list of Category and Item objects within it.
- An Aisle object can have a list of Category objects. A Category object can have a list of Item objects within it.
- An Aisle can have a list of Item objects. A Category object can have a list of Item objects.
In each case, an Item will logically have a Category object within it. I have a DAO for each domain object, so depending on the way it's done, the sql changes a little. Any thoughts?