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 rukes 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(Dictionaryvalues) { 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:
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.