Re: Is this too much OOP?
- From: Bruno Desthuilliers <bdesth.quelquechose@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Sep 2006 22:35:15 +0200
Frans Bouma a écrit :
Bruno Desthuilliers wrote:
Frans Bouma a écrit :
(snip)
If you then place the associations with department (for managing)
and companycar in the Employee class, also the employee instance
from John Doe III from the postoffice below in the dungeon has a
property 'ManagesDepartment' and 'CompanyCar'. They might be null,
but the properties are still there.
Some might say "so what", but others might want to have types which
aren't polluted with fields which don't belong there and are
members of subtypes, like the reference to companycar or department.
The problem here is that a manager is not a special type of employee,
it's an employee that has a special role - possibly at a given moment.
Ok, but only in the limited context of the given example sentence
(thus 'manager is subtype of employee'). If you add the essential
information that a manager manages a department, how would you do it
then? Still place the 'managesdepartment' association in Employee?
Obviously not. Please use your brain.
.
- References:
- Is this too much OOP?
- From: needin4mation
- Re: Is this too much OOP?
- From: Bruno Desthuilliers
- Is this too much OOP?
- Prev by Date: Re: Abstract public member variales?
- Next by Date: Re: Is this too much OOP?
- Previous by thread: Re: Is this too much OOP?
- Next by thread: Internal State vs. Navigating Associations
- Index(es):
Relevant Pages
|