Constructor

The constructor of a class is an operation that is invoked transparently when an instance of this class is created. A constructor contains the actions to be carried out during the creation of an object. In the presence of a relation of generalization, the constructor of the super class is called before the constructor of the class itself. The constructor can be omitted in which case a default constructor is created by Netsilon. A constructor can also be overloaded, in which case the parent constructor is determined according to the types of the parameters passed to the super operator. When present, the call to super must be the first instruction in the body of a constructor.

To be identified as such, a constructor must bear the name of the class in which it is defined and have the return type Void.

Properties
Name Have to be the name of the class in which it is defined.
Visibility  public: an instance of this class can be created in the methods of the class, in the subclasses and outside of the class.
 protected: an instance of this class can be created in the methods of the class and the subclasses
 private: an instance of this class can only be created in the methods of the class.
Keywords none is the only valid option
Library name Meaningless
Return Type The type has to be Void.
Is query Must not be checked.
Stereotype Ignored
Arguments A sequence of typed formal parameters. A parameter is treated in mode in. It has:
a name: name of the formal parameter (mandatory)
a type: the type of the parameter:
a Xion data type: Boolean, Byte, Date, Double, Float, Int, Integer, Long, Real, Short, String, Text, Time
the root class of all business model classes: OclObject.
an enumeration type
a class
a collection type
: Collection, Set, Bag or Sequence
  TOC ] Previous ] Next ]