Advertisement

06.29.2008 at 06:32PM PDT, ID: 23525706
[x]
Attachment Details

Show me the code for a simple factory example

Asked by newbieweb in .Net Editors & IDEs, Microsoft Visual C#.Net

I'm very  new to design patterns and using a factory to instantiate objects which inherit an interface.

Could someone give me a simple example to show how to create a factory, and defer instantiation to a sub class?

I use C#.NET - VS 2005

thanks,
newbiewebStart Free Trial
 
Loading Advertisement...
 
[+][-]06.29.2008 at 06:39PM PDT, ID: 21896190

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Visual C#.Net
Sign Up Now!
Solution Provided By: philipjonathan
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.29.2008 at 07:27PM PDT, ID: 21896319

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 07:27PM PDT, ID: 21896320

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.29.2008 at 07:30PM PDT, ID: 21896327

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 07:34PM PDT, ID: 21896337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 07:44PM PDT, ID: 21896356

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 07:51PM PDT, ID: 21896373

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628