hi guys, Can anybody give brief idea of class relations?
+1
A:
Likely the term is referring to the type of relationship between two classes, for example:
- inheritance: class B has an is a relationship with class A when B extends A
- composition: class B has a has a relationship with class A when B contains an instance of A in its properties
- dependency: class B has a uses relationship with class A when B takes a reference to A and invokes some method on it
tvanfosson
2010-09-15 12:42:40
Don't forget the obvious and most common: no relationship whatsoever...
Oded
2010-09-15 12:44:07
Well....ok yeah sure this is *correct* and all, but it's not nearly as fun :)
Nick Craver
2010-09-15 12:44:19
You're forgetting one, the hate relationship, it's when class B continuously calls the destructor on class A, no matter how much resources class A gives to class B
Jimmy Hoffa
2010-09-15 12:44:40
@Nick - to be fair, I *did* vote up Jimmy Hoffa's comment.
tvanfosson
2010-09-15 13:44:09