This is starting to make sense now. I can imagine how I would create
the CFCs.
A couple questions, though; would there actually be anything in the base
Roles CFC that would not already be in the main User CFC?
If I wanted to know if a user was, for example, a student, would it be
so simple as to checking for the existence of the Roles array element
that holds the Student CFC instance? If so, I would see that as being
either part of the User CFC or Roles CFC. Now that I think about it,
Roles CFC may be the best place for that function.
Thanks. Today will be a good day to play around with this idea and the
code.
M!ke
_____
From: Sean Corfield [mailto:[EMAIL PROTECTED]
Sent: Friday, July 23, 2004 12:18 AM
To: CF-Talk
Subject: Re: CFC Design for Multiple Person Roles
On Thu, 22 Jul 2004 19:39:17 -0500, Dawson, Michael
<[EMAIL PROTECTED]> wrote:
> Sean, this sounds interesting, but I'm unsure how to implement it.
User has-a Role array - so a User CFC has variables.roles which is an
array of Role CFCs. User does not extend anything.
Employee extends Role. Faculty extends Role. Student extends Role.
Role does not extend anything.
"is-a" means 'extends' (inheritance).
"has-a" means variables.xxx (composition / aggregation).
Inheritance should be rare in your programs - it should probably never
be the first choice for the relationship between two classes.
--
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]
- CFC Design for Multiple Person Roles Dawson, Michael
- Re: CFC Design for Multiple Person Roles Jamie Jackson
- Re: CFC Design for Multiple Person Roles Joe Rinehart
- Re: CFC Design for Multiple Person Roles Sean Corfield
- Re: CFC Design for Multiple Person Roles Joe Rinehart
- Re: CFC Design for Multiple Person Roles Sean Corfield
- RE: CFC Design for Multiple Person Roles Dawson, Michael
- Re: CFC Design for Multiple Person Roles Sean Corfield
- RE: CFC Design for Multiple Person Roles Dawson, Michael
- RE: CFC Design for Multiple Person Roles Dawson, Michael
- RE: CFC Design for Multiple Person Roles Dawson, Michael
- Re: CFC Design for Multiple Person Roles Sean Corfield