C# (CSharp) Habanero.BO.ClassDefinition Namespace

Classes

Name Description
MultipleRelationshipDef Defines a relationship where the owner may relate to more than one object.
PrimaryKeyDef Manages the definition of the primary key in a for a particular Business Object (e.g. Customer). The Primary Key Definition defins the properties of the object that are used to map the business object to the database. The Primary key def is a mapping that is used to implement the Identity Field (216) Pattern (Fowler - 'Patterns of Enterprise Application Architecture') In most cases the PrimaryKeyDefinition will only have one property definition and this property definition will be for an immutable property. In the ideal case this property definition will represent a property that is globally unique. In these cases the primaryKeyDef will have the flag mIsGUIDObjectID set to true. However we have in many cases had to extend or replace existing systems that use mutable composite keys to identify objects in the database. The primary key definition allows you to define all of these scenarious. The Application developer should not usually deal with this class since it is usually created based on the class definition modelled and stored in the ClassDef.Xml XmlPrimaryKeyLoader.
RelKeyDef This class contains the definition of a Foreign Key that defines the properties RelPropDef that that forms a relationship between two Classes. This class collaborates with the RelPropDef, the ClassDef to provide a definition of the properties involved in the RelationshipDef between two IBusinessObject. This provides an implementation of the Foreign Key Mapping pattern (Fowler (236) - 'Patterns of Enterprise Application Architecture' - 'Maps an association between objects to a foreign Key Reference between tables.') the RelKeyDef should not be used by the Application developer since it is usually constructed based on the mapping in the ClassDef.xml file. The RelKeyDef (Relationship Key Definition) is a list of relationship Property Defs RelPropDef that define the properties that form the persistant relationship definition (RelationshipDef between two Business object defitions (ClassDef. IBusinessObject.
RelationshipDef Defines the relationship between the ownming Business Object (IBusinessObject and the related Business Object. This class collaborates with the RelKeyDef, the ClassDef to provide a definition Relationship. This class along with the RelKeyDef and RelPropDef provides an implementation of the Foreign Key Mapping pattern (Fowler (236) - 'Patterns of Enterprise Application Architecture' - 'Maps an association between objects to a foreign Key Reference between tables.') The RelationshipDef should not be used by the Application developer since it is usually constructed based on the mapping in the ClassDef.xml file. The RelationshipDef (Relationship Definition) is used bay a ClassDef to define a particular relationship. Each relationship has a relationship name e.g. A relationship betwee a person and a department may manager, employee etc. The related Class e.g. A Department definition would contain a relationship definition to a Person Class. (to allow for the person class to be in a different assemply the assembly name is also stored. The list of properties the define the Foreign key mapping of relationship between these two classes is stored using the RelKeyDef. The Relationship also stores additional information such as DeleteParentAction and order critieria. The DeleteParentAction defines any constraints that the relationship should provide in the case of the parent (relationship owner e.g. Depertment in our example) being deleted. E.g. If the department (parent) is being deleted you may want to delete all related object or prevent delete if there are any related objects. In cases where there are many related objects e.g. A Department can have many Employees the relationship may be required to load in a specifically order e.g. by employee number. The order criteria is used for this.
SingleRelationshipDef Defines a relationship where the owner relates to only one other object.
SuperClassDef Manages a super-class in the case where inheritance is being used.
UIGridColumn Manages property definitions for a column in a user interface grid, usually as specified in the class definitions xml file. The UIGridColumn can be for
  • A Reflective Property e.g. an Order BO may have a property "CustomerName" that is declared on the Order BO class directly but is derived from the Customer class and therefore does not have a PropDef associated with it.
  • A Defined Property i.e. a normal property of the BO that is mapped to a column in the database e.g. for Order BO an OrderNumber. This property will have a PropDef.
  • A Related Property Habanero has the ability to define a property for a grid etc. via its relationships e.g. for a grid showing order details we may want to show the CustomerName and CustomerCode. We could define these as properties on the Order BO and use Reflective Properties (as above) or we could declare the Related Properties i.e. Customer.CustomerName and Customer.CustomerCode. Habanero will then find the PropDef for the Related Property via its defined relationships. A Related Property can be defined via any of the Business Objects single Relationships.