Repository Factory With Pluggable Database Provider - 4 Hours Including Custom Tooling

Repository Factory With Pluggable Database Provider - 4 Hours Including Custom Tooling

by David Hayden ( Microsoft MVP C# ), Filed: Enterprise Library

 

I find that talking about things in forums can sometimes be a complete waste of time because no matter how much you try to get people to understand the value of something or what you are trying to achieve, you could have just built the damn thing yourself in the same amount of time :) In fact this is what I did today in about 4 hours. I created a completely pluggable version of the Repository Factory that does not require Enterprise Library and has an improved Enterprise Library GUI Plug-In to support pluggable database providers.

I am not going to talk about it in depth, because I am tired of talking about it and you are probably tired of hearing about it :) I will just show a few images with a little commentary.

Here is the new Enterprise Library Plug-In for the Repository Factory that supports multiple providers and the ability for you to pick a default provider. We have the DAAB and one I made myself:

 

Repository Factory Pluggable Model

 

Go ahead and pick the one you want. Let's go with my custom provider, Hayden:

 

Repository Factory Pluggable Model

 

Now since I am using my custom provider, I have no need for any assemblies associated with Enterprise Library which greatly simplifies the dependencies. All I need is my provider and the Repository Factory Assembly. Very simple.

 

Repository Factory Pluggable Model

 

If I decide to use the Enterprise Library DAAB, no problem. Add all those Enterprise Library assemblies that are required and a simple assembly that makes Enterprise Library a provider as opposed to a dependency.

 

Repository Factory Pluggable Model

 

Now I have a wonderful Repository Factory that will run with any database provider- Enterprise Library or any you choose to create yourself.

Here are the other posts which frustrated me enough to create the new version that supported pluggable database providers:

 

Source: David Hayden ( Microsoft MVP C# )

Filed: Enterprise Library

posted on Saturday, August 25, 2007 6:56 PM

Main

News

Green Tea

.NET Development

Enterprise Library

Patterns & Practices