Factory class

KeepYourMind vyacheslav at blue-code.org
Fri Mar 20 00:50:28 PDT 2009


dennis luehring Wrote:

> > void main()
> > {
> >     auto pizza = PizzaFactory.factory();
> >     pizza.doSome(); // OK
> >     pizza.doSomeA(); // error: IPizza.doSomeA() not found
> > }
> 
> you interface has only doSome() and that is what factory returns
> 
> and for all others: factories and cast don't belong together
> 
> you interface should fit your overall needs

Got it. Thanks to all.


More information about the Digitalmars-d-learn mailing list