[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Nedarving



On 17 Mar 2001, Erwin S. Andreasen wrote:

> On Sat, 17 Mar 2001 10:06:18 +0100, Martin E. Nielsen wrote:
> 
> >Hvordan tjekker jeg om et objekt er af en given
> >type? 
> >F.eks. hvis "Geometry" er en klasse hvorfra jeg
> >har nedarvet både "Circle" og "Square", så er
> >begge self. af typen Geometry, men hvordan tjekker
> >jeg om det er det ene eller andet?
> 
> Det bør du ikke. Hvis du har noget funktionalitet der er forskelligt afhængigt
> af type, bør det ligge i en virtuel metode i klassen.

Ikke desto mindre er det jævnligt praktisk at vide hvad klasse det er,
f.eks. ved debug. Og, det er irriterende at skulle lave en metode for hver
eneste klasse, der skriver "hej, jeg er en ...".

Synes jeg.

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Unix is here to stay. The Internet is Unix, all network administrators cut 
their teeth on Unix, and many of them say they'll give up Unix when you pry
it from their cold, dead fingers.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *