The Builder Pattern in .NET: Listing 6

Listing 6: Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VSMBuilderPatternDemo.Builder;
namespace VSMBuilderPatternDemo
    class Program
        static void Main(string[] args)
            BrewMaster brewMeister = new BrewMaster();
            brewMeister.SetBeerBuilder(new AmberAleBuilder());
            Beer amberAle = brewMeister.GetBeer();
            brewMeister.SetBeerBuilder(new StoutBuilder());
            Beer stout = brewMeister.GetBeer();

About the Author

Eric Vogel is a Senior Software Developer for Red Cedar Solutions Group in Okemos, Michigan. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at [email protected].

comments powered by Disqus


.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events