Operation

The operations, methods and display methods constitute the behavioral feature of a class. An operation is a specification. It should be implemented by one or more methods or display methods in the class where it is defined or in the subclasses.

Properties
Name Name of the operation. It is mandatory.
Visibility  public: the operation is accessible in the methods of the class, the subclasses and from outside of the class.
 protected: the operation is accessible in the methods of the class and the subclasses
 private: the operation is accessible only in the methods of the class.
Keywords none: operates on instances of the class
static: operates on the class itself
native: the implementation of the operation must be written by the programmer in an external library
contextually_native: the implementation of the operation must be written by the programmer in an external library
Library name The name of the library that contains the implementation of an operation whose keywords are native or contextually_native (see below)
Return Type The type Void if the operation specifies a procedure.
The type of the result returned by the operation if it specifies a function:
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
Is query Can be checked if this operation has no side-effect. This is semantically checked at compile time.
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
Native operations

A native operation specifies a static (class) operation whose implementation is written in an external library by the programmer. The name of the implementing method must be the same as the name of the operation. The name of the library in which it is defined must be entered in the Library name property.

PHP: The qualified library name indicates the name of the library file and the path to the library.

Ex: Utilities will include the file Utilities.class.php

The programmer must write the file Utilities.class.php and store it directly under the root folder in the navigation model (directly under the folder htdocs on disk).

Afolder::Utilities will include the file Afolder/Utilities.class.php

The programmer must store the file Utilities.class.php in the folder Afolder under the root folder in the navigation model (under the folder htdocs/Afolder on disk). The file should begin with :

<?

define (__Utilities, "true");

and end with:

?>

 

JSP, Servlet: The qualified library name indicates the name of a class, a package and a path to the file.

Ex: Utilities will expect the file Utilities.java

The programmer must write the file Utilities.java and store it directly under the root folder in the navigation model (directly under the folder htdocs on disk). The name of the class must be Utilities, it must be public and defined in the package com.site where site is the name of the site (root node in the browser). The implementing method must be defined as public static.

Afolder::Utilities will expect the file Afolder/Utilities.java that contains a class named Utilities defined in the package com.site.Afolder where site is the name of the site.

 

The formal parameters of a native operation in Xion are mapped to native types in the same order. In the case of a contextually_native operation, a context parameter is inserted in first position in the sequence of parameters. This parameter holds for example a connection to the database.

PHP: the implementing contextually_native method should define the parameter &$ctxt in first position. The type of this parameter is an instance of the class Context.

JSP, Servlet: the implementing contextually_native method should define the parameter com.site.Context ctxt in first position where site is the name of the site.

PHP type mapping
Xion type Mapped PHP "type"
Boolean logical "type"
Integer, Byte, Short, Int, Long integer "type"
Real, Float, Double floating point "type"
String, Text string "type"
Date class OclDate
Time class OclTime
OclAny class OclAny
OclObject class OclObject
Collection(...) class OclAnyCollection
Bag(...) class OclAnyBag
Sequence(...) class OclAnySequence
Set(...) class OclAnySet
A business model class class with same name starting with C_
Java type mapping
Xion type Mapped java type
Boolean boolean
Byte byte
Short short
Int int
Long long
Integer long
Float float
Double double
Real double
String, Text String
Date class OclDate
Time class OclTime
OclAny class OclAny
OclObject class OclObject
Collection(...) class OclAnyCollection
Bag(...) class OclAnyBag
Sequence(...) class OclAnySequence
Set(...) class OclAnySet
A business model class class with same name starting with C_
   
 
TOC ] Previous ] Next ]