473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Objects, Abstract Classes or Interfaces

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
2 1102
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Vishal Gandhi | last post by:
Hi , Please help me by advising an real life scenario where Abstract Classes should be used over Interfaces or vice versa . Whats the basic difference between Abstract Class and interface other...
12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
6
by: Dan Sikorsky | last post by:
If we were to define all abstract methods in an abstract class, thereby making that class non-abstract, and then override the heretofore 'abstract' methods in a derived class, wouldn't that remove...
9
by: phl | last post by:
hi, I am kind of confused aobut interfaces and abstract classes. In short as I understand it, an interface is like a contract between the class and the interface, so that certain funtions must...
38
by: Radi Radichev | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines...
9
by: Sean Kirkpatrick | last post by:
To my eye, there doesn't seem to be a whole lot of difference between the two of them from a functional point of view. Can someone give me a good explanation of why one vs the other? Sean
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
6
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.