Views: 8.1K
Replies: 1
Archived
|
Abstract Factory pattern -- Structural example with interfaceHi,
Can someone show me how to do the sample example of abstract factory: "Abstract Factory Pattern - Structural Example" as outlined in this site, but with using an Interface? Regards, Amees Amees Bai, Jul 16, 2011
|
|
Reply 1You could replace the AbstractFactory class with this:
public interface AbstractFactory { AbstractProductA CreateProductA(); AbstractProductB CreateProductB(); } You could also replace the abstract Product base classes (AbstractProductA and AbstractProductB) with this: public interface AbstractProductA { } public interface AbstractProductB { void Interact(AbstractProductA a); } Hope this helps. Mathieu Lavigne, Aug 01, 2011
|