Re: OOP Inheritance
- From: "Tom Leylan" <tleylan@xxxxxxxxxx>
- Date: Thu, 29 Mar 2007 19:57:29 -0400
I'll offer the opinion that it doesn't make perfect sense :-)
Would temporary employees and full-time also be subclasses? Are there then
subclasses of FemaleTemporary and MaleTemporary? How about former employees
and retirees who still get pension checks, more subclasses? Does a company
class have another collection for Consultants?
So imagine the app has been written and you're entering a new employee... is
the code instantiating a new FemaleEmployee() or MaleEmployee() or does it
have to ask that question first? Have you ever seen an app ask the sex of
the individual first? Let's say you need to fetch a person out of the
database do you instantiate an employee by passing a social security number?
And what happens if that person is a consultant? Wouldn't the datatype of
the variable tend to be wrong? You'd have to know at the time the SSN was
keyed in which type of object you expected back when all the user wants is a
person's personnel record.
Food for thought...
"RSH" <way_beyond_oops@xxxxxxxxx> wrote...
Thanks that makes perfect sense.
What collection is best for storing objects in the scenerio you cite
below?
"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:%23Ss5qticHHA.4032@xxxxxxxxxxxxxxxxxxxxxxx
RSH,
A company has a collection of 0 or more employee's
The empoyee's are a property for the company, but a class itself which
can inherit female and male employees.
Cor
.
- Follow-Ups:
- Re: OOP Inheritance
- From: Cor Ligthert [MVP]
- Re: OOP Inheritance
- References:
- OOP Inheritance
- From: RSH
- RE: OOP Inheritance
- From: Kerry Moorman
- Re: OOP Inheritance
- From: RSH
- Re: OOP Inheritance
- From: Cor Ligthert [MVP]
- Re: OOP Inheritance
- From: RSH
- OOP Inheritance
- Prev by Date: Re: OOP Inheritance
- Next by Date: Re: Trouble of GDI+ generic error!
- Previous by thread: Re: OOP Inheritance
- Next by thread: Re: OOP Inheritance
- Index(es):