> Now that I have thought about this for a day or two, here is a very
> basic pseudo-model of what I have so far:
...
> In these examples, GetCourses() will query different information
> depending on the role. Therfore, I will override the methods in each
> subclass. This makes sense for the first three subclasses.
Sounds reasonable.
> Employees, however, will not have any courses. In that class, should I
> just have Employee.GetCourses() throw an error, or throw something in
> the Role class that covers all possible causes of not having any
> courses?
I would have Role throw the error (and Employee would not define
getCourses() at all). After all, calling getCourses() doesn't make
sense on a bare Role object (which users could instantiate) so that's
what should throw the error, IMO.
--
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

