TWiki
>
WebXEO Web
>
XeoPrimer
>
XeoPrimerConcepts
(revision 1) (raw view)
Edit
Attach
Tags:
tag this topic
create new tag
,
view all tags
-- Main.PedroRio - 06 Dec 2010 ---+ XEO Concepts This chapter introduces the basic concepts necessary to use the XEO framework an XEO's approach to development. ---+++ XEO's approach to development XEO was designed from scratch with the purpose of modelling business (real-world) entities using an object oriented approach, as the team felt that that was the most natural way of developing a web-application. Being able to create an entity, its data model and web pages for listing all instances of that entity (with powerful options such as ordering and grouping), editing single instances and searching a particular instance, while still being able to use customized logic to implement behavior, without dealing with all the low-level complexities was truly the ultimate goal. Developing starts by defining a set of entities (XEO Object Models) and their properties, using XEO Studio's Object Model editor (basically a graphic editor for a specific XML language). Those entities are processed by the framework in a processes known as "XEO Build" which generates the data model, and support classes to interact with the entities. Using the Object Model as a base, web viewers for listing, edit and search instances can be "scaffolded" (ala Ruby on Rails) by XEO Studio. As seen above, using XEO is all about modelling business entities as XEO Object Models, which will be used by the framework to create the data model, logic and web layer for each of those entities, which can then be further customized to fit the business logic of the application. Let's begin with the basics of a XEO Object Model. ---+++ XEO Object Model An Object Model is the XEO representation of a business entity. Almost every business entity can be described in a number of "atributes" and relations with other entities (be it relations of extension, 1-1 relation, or 1-N relation). For example, if we're modelling a entity that represents a "Book" in real life, that book would probably have attributes such as the book's title, the author's name, the edition number or category list (drama, romance, etc...) of the book. ---+++++ Attributes In a XEO Object Model, attributes modelling the properties of a business entity can be of different types. XEO provides attributes that represent Textual values (AttributeText), Numeric Values (AttributeNumber), Date and Time values (AttributeDate and AttributeDateTime), Sequential Values (AttributeSequence), Long textual values (AttributeLongText) and Boolean values (AttributeBoolean) as well as attributes to make a 1:1 relation (single relation - AttributeObject) and to make a 1:N relation (a relation to a collection of objects - AttributeObjectCollection) Each of those types of attribute have specific properties which can be set to customize their behavior, which we'll see further in the documentation. These properties vary with the type of attribute, naturally. For example, a Numeric Value can have a property _maxValue_ and _minValue_ (which specify maximum and maximum values for the attribute) while a collection attribute can have the maximum number of objects to which the first can relate to (or declare the type of objects to which the first can relate to) ---+++++ Custom Behavior (Logic) One of the defining features of XEO is the possibility to associate business logic directly to the Object Models, and also with their attributes. By allowing business logic to be "embedded" in the Object Model, instances of a given model are now almost like "living entities" which respond to events and have customized actions all without complex code managing events handling and etc. Custom Business Logic is defined using the Java Language and interaction with the current instance object (or other objects) can be done by using XEO's Java API. Such logic can influence the viewer layer, because logic can determine whether a given object/attribute is visible, required, etc... Let's take a look at the possibilities for defining business logic in an Object Model. ---++++++ Attributes Attributes themselves can have logic associated. For example, a given attribute may have a default value that is calculated, or its value may need be validated when its value is changed (and that validation, may required more or less complicated operations). Attributes can have logic to define the following * <strong>Validation </strong>(code that will run when the parent instance object is saved, to check it the current value of the attribute is valid) * *Default Value* (code that will run when the parent instance object is first saved and the value of the attribute was not set, default value can be made to depend on the values of other attribute) * <strong>Requirement </strong>(code that determines whether or not the value of this attribute must be set before the parent object can be saved) * <strong>OnChange </strong>(code that will run whenever the value of this attribute is changed) * *Disabled When* (code that will determine when the attribute is disabled (i.e. its value cannot be changed)) * *Hidden When* (code that will determine when the attribute is hidden - this logic is directly associated with the viewers layer * *Formula* (code that will run to determine the value of the attribute, allows to do calculations and such) ---++++++ Events Every instance of an Object Model can react (i.e. execute Java code) to certain events of its life cycle. ---++++++ Methods Methods in an object ---++++++ OPL (Object Policy Labeling) OPL is a Attributes RequiredWhen, DisabledWhen, Required XEO Interfaces / Extension Orphan / Non-Orphan ---+++++ XEO Package XEO Object Models can be logically grouped in XEO Packages (more or less like Java Packages) ---+++ XEO Builder The XEO Builder is responsible for .... ---+++ XEO Web Components Aqaaaa List Viewer Edit Viewer Lookup Viewer
Edit
|
Attach
|
P
rint version
|
H
istory
:
r26
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2010-12-07
-
PedroRio
WebXEO
XEO Primer
-
Instalation
-
Introduction
-
Concepts
-
Architecture
-
XEO Library
-
Deploy to EAR
-
PreferenceStore
XEO - Core
-
XEO Model Reference
-
Security
-
Java API
-
BOL
-
XEOQL (BOQL)
-
Administrating
-
Background Tasks
-
boConfig.xml
-
Web.xml
-
Known Issues
-
XEO Flags
XEO - XWC
- Web Components
- Java Samples
- Custom Components
- Component Plugins
- Internationalization
- Viewer Events
- Value Change Listeners
- XUIServlet
- XeoLocalization
- XvwTemplates
Create New Topic
WebXEO Web
No permission to view
TWiki.WebTopBar
No permission to view
TWiki.WebBottomBar