So, it might be a very fundamental question, but I'm pretty confusing right now...It's all about Element and ElementCategory: an element belongs to a category, a categoty can have many elements - a straightforward one to many relationship.At the database level, I have two tables:Element(element_id, category_id, element_name)Category(category_id, category_name)At the application level (Java), I would have:class Element { int id; String name; Category category; }class Category { int id; String name; Collection elements; }My question: did I have the right approach, both at the database level and application level? What kind of relationship is that in OOD? has-a, is-a, inheritance, generalization relationship or whatsoever...Thanks in advance for any constructive comments and answers.
Hierarchy in ER and OO Model
java;object oriented;object oriented design;database design;relational database