Factory class

dennis luehring dl.soluz at gmx.net
Thu Mar 19 13:21:59 PDT 2009


> 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


More information about the Digitalmars-d-learn mailing list