The RequirementContainer class

 

Overview

class RequirementContainer extends RequirementElement;

 

A RequirementContainer defines a hierarchy that breaks down the requirement model. A RequirementContainer can contain RequirementContainers or Requirements.

 

A RequirementContainer belongs to its parent RequirementContainer, except for the root RequirementContainer, which belongs to a RequirementProject.

 

A RequirementContainer can be typed by a PropertySet. In this case it also has a default PropertyValueSet which stores all PropertySet properties default values (see PropertyValue). These default values are used to initialize new Requirements property values and new RequirementContainers default values.

 

All RequirementContainer and Requirements belonging to a typed RequirementContainer must have the same type.

 

As you can see from the diagram below, goal containers and business rule containers are simply RequirementContainers stereotyped respectively «goal_container» or «business_rule_container».

 

 

Detailed class diagram for RequirementContainer

 

See also:              Requirement, RequirementElement, PropertySet, PropertyValueSet, RequirementProject

 

 

RequirementContainer properties

The class has the following associations:

·         Owned:RequirementElement: Designates owned requirement containers (see RequirementContainer) and requirements (see Requirement).

·         Type:PropertySet: PropertySet typing the RequirementContainer

·         DefaultSet:PropertyValueSet: set of default PropertyValues for all the PropertySet properties.

 

 

RequirementContainer consistency rules

Composition:

·         A RequirementContainer belongs to a RequirementContainer or to the RequirementProject.

 

Type:

·         If the owner RequirementContainer has a type, the RequirementContainer must have the same type.

 

Default set:

·         If the RequirementContainer has a type, it must have a default value set (PropertyValueSet) of the same type.

·         If the RequirementContainer has no type, it must have NO default value set.

 

 

RequirementContainer methods

 

RequirementContainer methods

 

 

PropertyValue getPropertyDefaultValue(in string key)

This returns the default PropertyValue for the key named Property (see PropertyValue).

 

 

Boolean setPropertyDefaultValue(in string key, in string value):

This changes a property default value. The corresponding PropertyValue must already exist in the default PropertyValueSet.  In this case the method returns true, otherwise it returns false.

 

 

updatePropertyValues()

This updates, creates or destroys the PropertyValueSet in order to be consistent with the type. All missing PropertyValues are created and defined with using the container’s default values. It does not update owned elements property values.

 

This method should be called after having modified the PropertySet properties, if you need to access the property values.

 

 

forceTypeConsistency()

This updates the RequirementContainer’s type in order to make it consistent with the owner container type. If any change is made to the type, this propagates it to the owned RequirementContainers and Requirements, and updates all RequirementElements property values by calling the updatePropertyValues method.

 

It returns true if any change has been made, otherwise it returns false.

 

This method is automatically called if needed at the end of the J session (when calling the sessionEnd() J method), but you must call it manually if you need to access the property values after having changed the RequirementContainer type, or when removing the RequirementContainer type.