Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IBar
- {
- void DoBar();
- void DoBaz();
- event EventHandler BarChanged;
- }
- public abstract class BaseBar : IBar {
- ... implementation ...
- public abstract void DoGaz();
- public virtual void DoFoo() {...}
- }
- public class ABar : BaseBar
- {
- ... implementation ...
- }
- public class BBar : BaseBar
- {
- ... implementation ...
- }
- public static class BarFactory
- {
- public static IBar MakeBar(string arg) {
- switch(arg) {
- case "xxx":
- return new ABar();
- case "qqq":
- return new BBar();
- ... and so on ...
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement