Pete Letkeman wrote:It would appear to me that while I think I know IS-A and HAS-A
You might just preparing too much so you got confused because too tired. Perhaps those two cases for a start could help you back on the track.
HAS-A. PC has a Fan. It has nothing to do with inheritance. PC just have a dependency, which appear to be Fan. In real world understanding, PC can't function properly without a Fan.
IS-A. Every programmer is an employee, but not every employee IS-A programmer. Last bit is very important in your specified case.
Basically on the first line:
What you just said is: I need programmer, take random employee and create software. Wait! Can't do that, he might don't know how to program. Oh I see...
How about, I'll pick employee who I'm sure knows how to program. Do you really know? Ok, I trust you then (cast).
Other than that is illegal without you assuring CEO you know that this employee is programmer. But, if when the time comes to write software, appears that programmer isn't really a programmer, you'll get an exception at runtime (ClassCastException - nope, he just said he knows how to program, apparently I misunderstdood, his actual title within a company is systems administrator).
Other way round is legal:
What you saying here is: I need some employee to do some work. Ok, I'll give you programmer, nevermind, he's programmer, but you asked me just give you employee, so it's fine.