0

A student has a student profile. A student profile can be searched and viewed by empolyers. The student profile contains:

  • Skills
  • Qualifications
  • Empolyment History

Is it possible to have StudentProfile as a superclass, and the skills, qualifications and empolyment history as sub classes? So that the enetitys can inherit the studentId.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by BitBlt
0

The flippant answer would be "Sure, you can do anything you want...but WHY?".

A more serious answer would be:
1. IF you are talking about a UML class diagram, you might consider having the Student class containing collections of the other classes as attributes, rather than sub-classing. The whole idea of subclassing is that subclasses have an "IS A" relationship with the superclass. So make these statements to yourself and see if they make sense: a "SKILL" is a "STUDENT"...hmm, not so much... a "QUALIFICATION" is a "STUDENT"...no again, etc. On the other hand, Association relationships specify a "HAS A" relationship with another class. They can be directional, too. So, say this: a "STUDENT" has a "SKILL"...seems okay...a "STUDENT" has a "QUALIFICATION" ...good again...and so on. Keep in mind too that inheritance also means inheriting methods (behavior) not just attributes (data).

2. If you are talking about a data structure design (completely different kind of modeling!) then yes, you can take the approach, but be careful of your terminology, because ERDs don't have "classes", they have Entities and Relationships.

Hope this helps!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.