dWebSpec Dictionary
CONTEXT: descriptors->behavior-define




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 behavior-define 
Prev  Topic  Next

The definition of objects for use on the view tier is conceptually platform independent. A class is defined with a variable that provides access to its instance. Then there is a question of what scope the instance would live in.

The scopes are generally application, session, request and page, in the order of their width; application scope being the widest. This is however not universal. For component platforms that keep the page state, this would be kept across requests. Furthermore, there could be a conversation scope across multiple pages. Notwithstanding, the concepts here are relatively uniform across the platforms.

 Seam  

Basic JSF Features 

SEAM Enhancements

Managed Bean

It is the same declarations allowed in the faces-config.xml tat Seam provides facilities for with annotations.

For managed beans, the mappings to dWebSpec behavior attributes to the annotations are shown below..

Attribute Implementation Annotation
id  
define-id @name("customerOrderBean")
define-class Class name
define-scope @scope("session")
details  
data-source  

Example of such specification is shown below.

BEHAVIOR DESCRIPTORS

id

type

data-source

value

define-id

define-class

define-scope

details

customerOrderBean define     customerOrderBean com.example.CustomerOrder. session  

The corresponding entry using Seam annotations would be as follows:

package com.example;

@scope("session")
@name("customerOrderBean")
class CustomerOrder {

Dependent Objects

The annotations described above are for the "managed components". These result in objects with framework managed life-cycle that are exposed to the view tier within contexts.

There is another mechanism for exposing objects to the view tier, using "outjection". With this, the parent object is in charge of the initial creation of the object; thereafter these objects have their own independent exposure within contexts. These are dependent object, since they depend on a component for the start of their life-cycle.

NOTE: There is also the mechanism of injection, as popularized by the Spring Framework; this assist in injecting dependencies to the components in a scheme that is not necessarily exposed to the view tier, as such not subjects for the behaviors.

For dWebSpec specification, an object is dependent, if in it definition it has data-source. The data-source would have influence on its life cycle. The implementation transformation for dependent objects is shown below.

Example of such specification is shown below.

BEHAVIOR DESCRIPTORS

id

type

data-source

value

define-id

define-class

define-scope

details

orderTypes define customerOrderBean   orderTypes com.example.OrderTypes session  

The annotation for this specification would show up in the parent class as shown below.

@out("session") OrderTypes orderTypes

NOTE: There is a choice between applying the annotation to the field or to its getter method.

Managed Beans Types

We have shown the declaration of managed beans; however there are different categories of such objects. These are mainly

EJB Stateful Session Bean
Entity Bean
EJB Stateless Session Bean
EJB Message Driven Bean
JavaBean (POJO)

The designations of these categories are not part of dWebSpec specification, which only capture the common denominators which is the class and object. Although the details attribute could be used to specify the categories, it should be noted that the aim of the behavior descriptor is integration. The true specification of the managed component would reside in the model specifications.

Validator

The specification of the validator classes is almost non-distinguishable from those for other objects. The point is that they are only applicable for validations and subscribe to specific interface.

id Any unique identifier used as the definition reference on the page
define-id formatValidator @name("formatValidator")
define-class com.example.FormatValidator FormatValidator
define-scope   N/A
details   description

The corresponding annotations are shown below:

package com.example;

@Name("formatValidator")
@BypassInterceptors
@Converter
class FormatValidator {

Converter

The specification of the converters classes is almost non-distinguishable from those for other objects. The point is that they are only applicable for conversion and subscribe to specific interface

id Any unique identifier used as the definition reference on the page
define-id creditCardConverter @name(“creditCardConverter”)
define-class com.example.CreditCardConverter CreditCardConverter
define-scope   N/A
details   description

The corresponding annotations are shown below:

package com.example;

@Name("creditCardConverter")
@BypassInterceptors
@Converter
class CreditCardConverter {

Prev Next