In order to
• | simplify the administration of Item Types |
• | allow intelligent searching |
it is possible for an Item Type to inherit the attributes of another Item type, or from many Item Types, any of which may themselves inherit other Item Types.
Creatable
To be able to create an item of a particulate Item Type then that Item Type must inherit (directly or indirectly) from the Root Type which contains the base fields, e.g. ID, Name, Owner, Type, Bucket, Date Created, Date Modified.
The Item Type must also have the 'Creatable' attribute set in the Process Modeller - See Administration Guide.
Version Item Types
All Versionable Item Types must inherit from Item Type Versionable Type which specifies Version specific attributes. Versionable Type inherits from Root Type so by inheriting from the former you also get the latter.
Abstract
An Item Type that does not inherit from the Root Type cannot be created and is called an Abstract Type. An Abstract ItemType is used to add a common set of attributes to a group of Item Types in an identical way.
For example:
Item Type "Network Device" inherits Root Type and also has Network related attributes (IP Address etc)
Item Type "Inherit - Asset" does not inherit from Root Type and is defined with 'Is Creatable' as false. It defines an Asset number and other Asset related information (e.g. dates)
[Note : prefixing the name of abstract Item Types with 'inherit' is not necessary but is a useful convention]
Item Type "Network Device" also inherits "Inherit - Asset"
Item Type "Printer" inherits the "Network Device" attributes and adds printer specific attributes (paper size, colour etc)
Item Type "Computer" inherits the "Network Device" attributes and adds Computer specific attributes (memory, processor, hard drives, USB ports etc)
Item Types "Laptop", "Desktop" & "Server" all inherit "Computer".
Benefits
By setting up the Item Types this way it is guaranteed that all attributes that should be the same actually are the same, i.e. in our example Laptops, Servers & Desktops are separate types of item but are guaranteed to have identical attributes.
Every item that is categorised as 'an asset' (i.e. inherits the 'Inherit - Asset' Item Type) will have the correct fields and can be searched as a group.
Searching
Searches made against the fields on an inherited Item Type will look at the items of all Item Types that inherit from it.
For example
Searching for Computers with a RAM > x will find all Laptops, Desktops and Servers that meet the criteria
Searching for Servers with a specific Hard Drive will only find Servers despite the field being on Laptop and Desktop Items
Searching for items with an Item Type of Inherit - Asset, specifying an Asset Date criteria, will search all Items that inherit "Inherit - Asset"
Searching for items with an Item Type of Inherit - Asset, with no criteria, will list every asset whatever Item Type it is.
Searching for items with an Item Type of Root Type and a created date of today will find all items created today
Restrictions
Abstract Item Types (do not inherit from Root) cannot be created. i.e. it must have 'Is Creatable' set to false.
An Item Type that is inherited cannot be created.
An Item Type cannot inherit itself
An Item Type cannot inherit an Item Type that inherits it. i.e. no loops
An Item Type can only be inherited once by any child.
e.g. Item Type A inherits parents B & C. This seems OK. But if B & C both inherit from D then indirectly A inherits D twice which is not permitted
An Item Type can only inherit one creatable parent. This is as a result of the previous point in that a creatable parent must inherit from Root Type, and the child can only inherit from Root Type once. A child Item Type can inherit from multiple Abstract Item Types, providing all restrictions are met.
Not Creatable
It is possible to define an Item Type to be "not creatable" (i.e. it is not possible to create an Item of this Item Type). This is mandatory for an Item Type that is inherited. In coding speak an Item Type that is inherited is 'Abstract' (C#) or 'MustInherit' (VB)
In the example above the Item Types "Network Device", "Computer" and "Asset" would all be 'not creatable'.
The 'Creatable' attribute is set in the Process Modeller - See Administration Guide.
See Also
Cimera Administration Guide. Item Type Inheritance.