Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abstract Factory in .NET
Message
From
16/10/2002 12:25:56
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
General information
Forum:
ASP.NET
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00706844
Message ID:
00711816
Views:
10
Hi Kevin,

Thanks for the reply. In an attempt to learn from the best <g>, I have another question for you: How are you handling support for multiple back-ends? Do you have a separate Database Manager class for each .NET Provider, or do you set properties on the one class?

Thanks again.

>Joel,
>
>>I just finished reading chapter 5 in your new book, which is excellent by the way. At the end of the chapter you talk about reflection and late binding. If you don't mind, I was wondering how you are implementing an Abstract Factory in .NET. Do you use a data-driven implementation, like you would in Fox, and take the performance hit for late binding? Or do you use a code-based implementation as described in the Design Patterns book? Just curious.
>
>Sorry I didn't get back to you sooner, I missed this message when you originally posted it.
>
>In answer to your question, in Mere Mortals .NET, I'm trying to use early binding wherever possible. For example, manager classes (Database Manager, Language Manager, etc.), are instantiated in factory methods of the application object as they are in MM VFP...there is a "CreateXXX" method for each manager object containing a single line of code that instantiates a concrete manager class. In subclasses of the application object, you can override this method and instantiate a different concrete class. This is similar to the factory described in the Design Patterns book, and I'm using this general pattern throughout MM .NET...whenever I instantiate an object, I do so in a factory method. That's not to say that I won't be offering a data-driven factory, but in the spirit of strongly typed .NET languages (and high performance), I opt for the early binding option.
>
>Regards,
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform