Re: casting to a derived class
- From: Rick Elbers <rick.elbers@xxxxxxxxx>
- Date: Wed, 18 May 2005 10:49:28 GMT
Kj,
You are describing another implementation of a visitor, which
would work if the OP has polymorph methods, which he has not
( he has DoThis() and DoThat())
Creational Patterns have nothing to do with the problem at hand, sorry
Rick
Thats
On 17 May 2005 20:29:19 -0700, "KJ" <n_o_s_p_a__m@xxxxxxxx> wrote:
>I'm not Rick, but Visitor is a design pattern that you don't need here.
>You need an interface. Just cast any of the derived classes to the
>interface, which they all implement. The actual implementation is what
>gets called at runtime, which is unique to every class that implements.
>
>
>You could even also use a factory method (another Design Pattern) to
>generate the specific types of instances you want via a string. But I
>wouldn't do that here.
.
- Follow-Ups:
- Re: casting to a derived class
- From: KJ
- Re: casting to a derived class
- References:
- casting to a derived class
- From: Steve Teeples
- Re: casting to a derived class
- From: Rick Elbers
- Re: casting to a derived class
- From: Steve Teeples
- Re: casting to a derived class
- From: KJ
- casting to a derived class
- Prev by Date: Creaing a control array of Radio Button in web application
- Next by Date: Re: C# very optimisation
- Previous by thread: Re: casting to a derived class
- Next by thread: Re: casting to a derived class
- Index(es):