--
PedroRio - 30 Jan 2011
XEO Object Model Reference
This section is a reference of all options regarding the creation of a XEO Object Model and it's divided in five (5) parts:
- General Model properties
- Attributes
- OPL
- Events
- Methods
General Model Properties
In XEO Studio, while editing the general properties of an Object Model, you'll see the following (depicted in figure
ModelRef.1)
Figure ModelRef.1 - General Properties Editing for an Object Model.
Reference of XEO Model General Properties
1 - Name
The name of the XEOModel, this name must be equal to the name of file. This is name that's used when referencing this XEO Model from other XEO Models (like when creating collection attributes, or relation attributes) or the name to be used in XEOQL expressions.
2 - Type
The type of the XEO Model. There are three different types of XEO Models:
- Object
- Abstract
- Interface
The most common type is "Object", which allows you to create instances of the given Model. The "abstract" type represents an abstract Model (much like an abstract class in Java) which allows you to define a set of attributes, events, etc... which you can later reuse in concrete (i.e. type "Object") XEO Models. The Interface type, represents an interface which Models can implement, therefore inheriting all of their attributes and becoming of that type (i.e. if Model A implements interface B, issuing a XEOQL expression of "select B" will return all instances of A, along will all other instances of Models that implement B).
You cannot create instances of Models that are either Interface or Abstract.
3 - Orphan
Determines whether instances of this Model are Orphans or not (
recall from the XEO Concepts). An orphan instance is one that can exist by it self, while a non-orphan instance is one that can only exist with a parent instance. Think of an invoice and an invoice line, it only makes sense for an invoice line to exist if it's inside an invoice.
While a Model can be declared an Orphan/Non-Orphan using this property, relations between Models can also change that situation.
See in Attributes.
4 - Extends
Any Model can extend other Model (single inheritance), inheriting it's attributes, events and methods. Any of those attributes, events and methods can be redefined in the extending Model. In this property you choose the name of the Model to extend.
5 - Description
A description of the Model, serves as documentation.
6 - Label
A label for the Model, it's used throught the application in places such as the "New OBJECT_LABEL" menu in toolbars, when a label of the Object Model is displayed.
7 - Mastertable
Not quite sure, what this does yet.
_
The
CardID of an Object Model is a way to identify it's instances. The name
CardID derives from the idea of an Identification Card (or Business Card) that people have. For a person you normally have their name, phone number, e-mail, etc. The
CardID property is declared using a syntax which allows to refer to the instance's attributes to compose an "Identification Card" for that particular instance. For example, if Object Model "A" has attributes
name,
task and
age and you use the following expression for the
CardID:
[name] is a [task]
And and instance has the following values for the name, task and description attributes (respectively): "John Smith", "Manager", "30". The
CardID for that instance will be:
John Smith is a Manager
If you use the following
CardID declaration:
[name] : [age]
The same instance would have the following
CardID.
John Smith : 30
Important:
- The CardID for each instance is a calculated value. It's not stored persitently, as such you can change it as many times as you want while building your application.
- The syntax for a CardID expression is basically the name of an Object Model attribute inside square brackets to refer to their value. Any other character will be interpreted as a literal text.
_
9 - Extends Java
Every Object Model is converted to a Java class that extends from the netgest.bo.runtime.boObject class. It's possible to make it that the generated Object Model extends from a different class (which, however, must extend from the boObject class), in order to do processing of something in a different way. In order to use that class as the base for the Object Model you'll need to type the fully qualified name of that class.
_
10 - Implemented Interfaces
A list of all the implemented interfaces by the current Model. An Object Model can declare that it implements any number of interfaces (and will inherit all of their attributes and events).
11 - Versioning
Activates versioning for the current Object Model. Whenever an instance of the current Model is saved, if any of its attributes are changed, a new version of the instances is created. The list of versions of a given instance can be seen in an edit viewer of the instance if the
renderListVersionBtn property of the
editToolBar component is true, in that viewer.
In order to have acess....
12 -
TextIndex
13 - Locale
14 - Database Manager
Attributes
a
OPL
a
Events
a
Methods
a