Re: Inheritance Collection Classes
From: Andrew (andrewt_at_nospam.dbasplus.com)
Date: 06/29/04
- Next message: Adriano: "Re: Hover delay"
- Previous message: AlexS: "Re: Object Size in memory"
- In reply to: NM: "Re: Inheritance Collection Classes"
- Next in thread: Andrew: "Re: Inheritance Collection Classes"
- Reply: Andrew: "Re: Inheritance Collection Classes"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 13:03:06 +1000
Thanks for the response. Your right my terminology is wrong.
I was rather hoping that there would be a better way of referencing the
parent class other than passing it to the child. This is the same as VB6.
Cheers.
"NM" <NM_656@hotmail.com> wrote in message
news:%23Pcv5UPXEHA.208@TK2MSFTNGP10.phx.gbl...
> Hi Andrew,
>
> class inheritance means that :
> if you have a class A that inherit class B so the class A has all class B
> caracteristics (Public and Protected attributes, procedures and
functions).
> it's like if you say that a baby got the eyes of his father and the mouth
of
> his mother;
>
> Now what you want to do (if I understand) is to have a class Customer that
> have an attribute Emails (which is a class or a collection of classes)
wich
> have a reference to the Customer class;
> To do that, create your class Emails with a constructor which take the
> Customer class in parameter and store it in an Emails class attribute :
>
> Class Emails
>
> Protected myCustomer as Customer
>
> Public Sub new (Byref c As Customer)
> myCustomer = c
> End Sub
>
> ...
>
> End Class
>
>
>
> Regards
>
>
> "Andrew" <andrewt@nospam.dbasplus.com> a écrit dans le message de
> news:%23KNQ9mNXEHA.500@TK2MSFTNGP09.phx.gbl...
> > I need to have a series of collection classes that inherit (I think)
from
> > each other. What is the best way to do this in .NET? In VB6 I had a
series
> > of collection classes each passing a reference to the parent object down
> the
> > tree.
> >
> > For example:
> > Customer(s) -> Email(s) -> Attachment(s)
> >
> > Or maybe:
> > Directory -> Directory -> Directory -> Files etc
> >
> > Do I still simply pass teh reference to the parent down the tree?
> > I also need the child classes to get information form the parent.
> >
> > You also can't put:
> >
> > Public Class cAttachments
> > Inherits System.Collections.CollectionBase
> > Inherits cEmail
> > ...
> >
> >
> >
>
>
- Next message: Adriano: "Re: Hover delay"
- Previous message: AlexS: "Re: Object Size in memory"
- In reply to: NM: "Re: Inheritance Collection Classes"
- Next in thread: Andrew: "Re: Inheritance Collection Classes"
- Reply: Andrew: "Re: Inheritance Collection Classes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|