By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,865 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,865 IT Pros & Developers. It's quick & easy.

Objects, Abstract Classes or Interfaces

P: n/a
I'm trying to get my head around objects and am asking for thoughts on this
idea.

If for example I were to implement a Person Object, there may be differnt
Person objects representing people of different cultures.

All Person objects have similar characteristics, ie Height, Weight, Age ect
but I imagine that there could be a method ie SayHello which Person objects
of different cultures would implement differently.

Now what i'm trying to figure out is whether the Person Class should be
abstract to cope with different cultures or whether I should create an
interface or both.

Thoughts and comments appreciated.
Regards
Wayne Phipps
Sep 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
CT
Hmm, I'd go for an inheritable/non-sealed class but not an abstract one. As
you point out, there are similar characteristics, so why not implement the
basic functionality and for some this will be all that's neded. Just make
sure it can be overridden and overloaded in derived classes. Just my
$0.02...

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"Wayne Phipps" <Wa*********@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
I'm trying to get my head around objects and am asking for thoughts on
this
idea.

If for example I were to implement a Person Object, there may be differnt
Person objects representing people of different cultures.

All Person objects have similar characteristics, ie Height, Weight, Age
ect
but I imagine that there could be a method ie SayHello which Person
objects
of different cultures would implement differently.

Now what i'm trying to figure out is whether the Person Class should be
abstract to cope with different cultures or whether I should create an
interface or both.

Thoughts and comments appreciated.
Regards
Wayne Phipps

Sep 21 '05 #2

P: n/a
It's time to learn patterns.

See the following link:
http://blogs.msdn.com/nickmalik/arch...21/328727.aspx

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Wayne Phipps" <Wa*********@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
I'm trying to get my head around objects and am asking for thoughts on
this
idea.

If for example I were to implement a Person Object, there may be differnt
Person objects representing people of different cultures.

All Person objects have similar characteristics, ie Height, Weight, Age
ect
but I imagine that there could be a method ie SayHello which Person
objects
of different cultures would implement differently.

Now what i'm trying to figure out is whether the Person Class should be
abstract to cope with different cultures or whether I should create an
interface or both.

Thoughts and comments appreciated.
Regards
Wayne Phipps

Sep 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.