This project is read-only.

Ading a new DataProvider type

This is what you have to do (assume your DataProvider provider is a Foo provider)
  1. Implement the IDataProvider interface (Get, Save, Purge etc)
  2. Make sure the namespace in which the DataProvider class is defined is called CIP4.DataProvider.Foo. When CIP4 is looking for the provider it will use that name and the run time bind will fail if it is not spelt correctly
  3. The class that implements the IDataProvider interface must be called 'DataProvider'
  4. Your provider executable must be in the #CIP4_HOME#\Binaries directory for CIPl to be able to find it. Add your provider to the setup project (make sure it goes in the setup's Binaries folder, not the application folder). Look at the post build event on any of the providers to see how the executable is copied around at build time
  5. Make the following changes to V04.04\CIPl\CIPl.Simple\CIP4ConnectionAttribute.cs
    1. Add 'Foo' to the ProviderTypesEnum enumeration
    2. Add a CIP4ConnectionAttribute subtype called CIP4FooConnectionAttribute that has a property for each of the properties required by a Foo DataProvider. The property values must be supplied by InternalGetValues and set by InternalSetValues calls
    3. Add a clause to the extended 'if' statement in GetActualConnection that builds an instance of the CIP4FooConnectionAttribute
    4. Add another case statement to internalGetActualConnection().
These notes are also available in the CIP4ConnectionAttribute.cs source file - it would be nice to keep them in sync...

So far as testing is concerned - 2 things:
  1. You should add tests for your provider to the various test projects (most are in the DataProvidersTest project) - at least for SimpleCrud,, DupsTest, DoConnectionForOneFred, MinimalObjectTest, TestBasicProduct, TestSubtypeProduct, AccessUsingQueries, DoGroupAndUserReferences, TestGetBlobsOneAtATime, TestGetBlobsWithOr, MultipleExternalIDCRUD, MultipleExternalIDCRUDPartialKey, TestLotsOfThreads. In addition, if the provider supports stream properties you should do TestSerializeStreams.
  2. You should try running the CIP4.MultiThreadTest application against your provider, especially trying cross process scenarios, i.e. run CIP4.MultiThreadTest in multiple command windows simultaneously

Last edited Oct 26, 2010 at 3:53 PM by PatrickThompson, version 4


No comments yet.