Created
December 29, 2011 14:57
-
-
Save rbwestmoreland/1534449 to your computer and use it in GitHub Desktop.
Properly Implementing the Abstracy Factory Pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
/// <summary> | |
/// An example abstract factory interface. | |
/// <para>The Abstract Factory pattern is a creational | |
/// pattern, whose purpose is to provide an interface | |
/// for creating families of related or dependent | |
/// objects, without specifying their concrete | |
/// classes.</para> | |
/// </summary> | |
public interface IAbstractFactory | |
{ | |
/// <summary> | |
/// Creates an instance of IObjectA. | |
/// </summary> | |
/// <returns>An instance of IObjectA.</returns> | |
IObjectA CreateInstanceA(); | |
/// <summary> | |
/// Creates an instance of IObjectB. | |
/// </summary> | |
/// <returns>An instance of IObjectB.</returns> | |
IObjectB CreateInstanceB(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public interface IObjectA | |
{ | |
void DoWork(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public interface IObjectB | |
{ | |
void DoWork(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment