Meta Data Plus (MDP) 2.0 is the underlying engine for some of the EPiServer Commerce subsystems such as the Catalog and Order systems. Business Foundation is a newer version of MDP and will eventually replace MDP. The engine has been developed to allow for use in the eCommerce Framework of EPiServer Commerce. The basic idea for MDP is to allow the extension of any object in the system with a series of Meta Fields. It is very similar to the way object oriented programming works. For example, in object oriented programming, you can create a base class Product and then create an object of the type Product called ElectronicProduct which will inherit all its properties as well as add some specific fields.
How it works
The root meta-class is based directly on a table in the database and called system meta class. Consider that to be an abstract meta class which has to be extended in order to use. When extended new attributes can be associated with a new meta class. Product will be a system meta class and ElectronicProduct will be a meta class which can be extended. The instance of the meta class that actually holds values is called meta object.
|Binary||MSSQL Common Type|
|Bit||MSSQL Common Type|
|Char||MSSQL Common Type|
|DateTime||MSSQL Common Type|
|Decimal||MSSQL Common Type|
|Float||MSSQL Common Type|
|Image||MSSQL Common Type|
|Int||MSSQL Common Type|
|Money||MSSQL Common Type|
|NChar||MSSQL Common Type|
|NText||MSSQL Common Type|
|NVarChar||MSSQL Common Type|
|Real||MSSQL Common Type|
|UniqueIdentifier||MSSQL Common Type|
|SmallDateTime||MSSQL Common Type|
|SmallInt||MSSQL Common Type|
|SmallMoney||MSSQL Common Type|
|Text||MSSQL Common Type|
|Timestamp||MSSQL Common Type|
|TinyInt||MSSQL Common Type|
|VarBinary||MSSQL Common Type|
|VarChar||MSSQL Common Type|
|Variant||MSSQL Common Type|
|Numeric||MSSQL Common Type|
|Sysname||MSSQL Common Type|
|Integer||Meta Data Type|
|Boolean||Meta Data Type|
|Date||Meta Data Type|
|Meta Data Type|
|URL||Meta Data Type|
|ShortString||Meta Data Type|
|LongString||Meta Data Type|
|LongHtmlString||Meta Data Type|
|DictionarySingleValue||Meta Data Type|
|DictionaryMultiValue||Meta Data Type|
|EnumSingleValue||Meta Data Type|
|EnumMultiValue||Meta Data Type|
|StringDictionary||Meta Data Type|
|File||Meta Data Type|
|ImageFile||Meta Data Type|
|MetaObject||Meta Data Type|
Not all of these properties have a visual designer associated with it, but all of them can be used to extend the meta class.
The MDP is designed in such a way that the resulting database structure has the fastest performance. Upon meta class creation the container data table and history tables are created as well as corresponding set of stored procedures and full text indexes (if full text functionality is enabled). The appropriate indexes are also put.
Meta data fields and classes
MetaFields are used to describe different properties associated with an element inside EPiServer Commerce. You can create a Meta Field of any type supported by Meta Data Plus.
EPiServer Commerce uses MetaClasses to describe different types of elements such as Categories and Products that are used in the creation and extension of the commerce solutions developed. MetaClass is a collection of MetaFields and the following types of MetaClasses are defined:
This MetaClass is used for the built in (CatalogNode and CatalogEntry) elements of EPiServer Commerce.
This is the MetaClass created when user defines a new MetaClass for a Category or Product. It is an always an extension of one the existing System Meta Classes.
Using MetaClasses and MetaFields
It is important that you understand the concepts of a MetaClass and MetaField which form the basis for Categories and Products to fully understand how they work in context to EPiServer Commerce. For a better understanding of MetaFields and MetaClasses we will consider an example of creating a product Book.
This product "Book" has the following properties attached to it:
In order to duplicate this product inside your solution you can create a Metaclass BookClass with its parent MetaClass as Entry. Now in this example the MetaClass BookClass is of type Mediachase.MetaDataPlus.User and the built in MetaClass Product of type Mediachase.MetaDataPlus.System. Your work is not done yet.
How will you assign the properties of Book to your BookClass? By creating Meta Attribute for each Property and then assigning them to your BookClass. For example the property Name could be a Meta Attribute of type ShortString and Price can be a Meta Attribute of type int. After you have created these Meta Attributes you can then assign them to your BookClass.