This project is read-only.

CIPl Overview

CIPl provides a serialization and storage abstraction layer plus a rules engine. The “meta data” required by CIPl is mainly provided through attributes on CLR types, for example

    [CIP4Item(AddAllProperties = true, Collection = "Organizations"),

    CIP4FileConnection(BaseDirectoryPath = "c:\\temp\\testfile")]

    public class OrganizationType


The client can also provide these parameters at run time, allowing, for example, sensitive information, such as passwords, to be passed in from a secure configuration store.

The rules engine is used to express queries in a store-independent fashion.

The primary objective of CIPl is to provide a scalable data store interface that is independent of any specific underlying store. Apart from performance, it should be possible to replace the underlying store without making any changes to the application.

The main components of the environment are as follows:

The client uses a strongly typed interface provided by a CIPl StrongWrapper object. For example:

StrongWrapper<ProductType> productWrapper = new StrongWrapper<ProductType>(Globals.DefaultLogger);

The strong wrapper provides a serializer to serialize objects to and from an Xml or Json representation. The objects are passed to a DataProvider which provides an abstraction over a store.

The StrongWrapper object will either get required “meta data” from attributes on the object provided as a generic parameter at compile time, or from interactions with the client at run time.

In the example above the OrganizationType has a CIP4FileConnection attribute that indicates that a file DataProvider provider will be used for the storage abstraction.

The same information can be provided using a GetValues delegate provided by the StrongWrapper. The GetValues delegate returns an enumeration value that indicates the type of DataProvider to use plus a dictionary populated with name-value pairs that will be used by the DataProvider to interact with the store. For example:

                wrapper.GetValues = delegate(Dictionary values)
                    values.Add("Database", "CIPlDataProvider0401");
                    values.Add("Host", "patrickt\\sqlexpress");
	            return ProviderTypesEnum.Sql;

There are two types of serializers provided, namely Xml and Json serializers – The serializers are generated on demand specifically for the type to be serialized. The serializer is generated if the serializer is absent or the serializer code is older than the code containing the type. A tool is added to Visual Studio at install time that can be used to generate the serializers for all the types in an assembly that have the CIP4Item attribute. 

There are several types of DataProvider available – currently:

  • Sql –each collection is mapped to a sql table in a SqlServer database. The required sql ddl is available in the install directory. The DataProvider uses the Host and Database parameters. You can also provide the ApplicationName, UserId and Password parameters.
  • MySql –each collection is mapped to a sql table. The required MySql ddl is available in the install directory. The DataProvider uses the Host and Database parameters. You can also provide the UserId and Password parameters.
  • File –each collection is mapped to a folder located in the BaseDirectoryFile folder . Each item is mapped to a separate file located in the collection’s folder. The DataProvider uses the BaseDirectoryFile parameter.
  • XmlFile –each collection is mapped to an xml file. All items are mapped to an xml element in the collection’s xml file. A single xml file can contain multiple collections. The DataProvider uses the XmlFileName parameter
  • Dictionary – collections are mapped to a dictionary, items are mapped to a key-value pair in the dictionary with the key being the ExternalID. The DataProvider uses the BaseDirectoryPath parameter.
  • S3 –collections are mapped to S3 buckets, items are mapped to S3 objects. The DataProvider uses the AccessKey and SecretKey parameters
  • Mosso – collections are mapped to Mosso buckets, items are mapped to Mosso objects. The DataProvider uses the UserName and AccessKey parameters
  • Cassandra – collections are mapped to a ColumnFamily, items are mapped to a value in the collections ColumnFamily (called ‘text’) in Cassandra. The DataProvider uses the ColumnFamily parameter
  • Mongo - collections are mapped to MongoDB collections. Items are serialized to Json.

Each of the above is represented by a CIPl attribute that can be provided with the declaration of the type.

See the Quick Start page for a brief overview of building an application using CIPl.

Last edited Oct 11, 2010 at 8:32 PM by CIOSAdmin, version 7


No comments yet.