|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using www.askbargains.com.BuilderDesignPattern;
namespace www.askbargains.com
{
namespace Client
{
class Program
{
static void Main(string[] args)
{
//create a constructor object to start building
Kid aKid = new Kid();
aKid.Name = "Elizabeth";
//Elizabeth use Monkey moid to make a monkey
Console.WriteLine("{0} start making a monkey",aKid.Name);
AnimalBuilder builderA = new MonkeyBuilder();
aKid.MakeAnimal(builderA);
builderA.aAnimal.ShowMe();
//Elizabeth use Kitten moid to make a kitten
Console.WriteLine("{0} start making a kitten",aKid.Name);
AnimalBuilder builderB = new KittenBuilder();
aKid.MakeAnimal(builderB);
builderB.aAnimal.ShowMe();
Console.Read();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.