|
|
|
The Model-Driven System Builder
|
|
JeeWiz Architect's Guide
|
|
|
|
Contents >
14. 'Business Object' Reference
|
|
|
14.30 Parameter Object
| Used on |
|
| Superclass | java:parameter |
| Description | 'parameter' is used to pass values into a method call.
This is 'parameter' in the business object model, which accepts constraints on the parameters value and allows the definition of the collection-element-type.
|
Contained Lists |
| 1 |
| Name | constraint |
| Type | constraint |
| Description | Constraints for this parameter.
|
| GenerateAllList | false |
|
|
Inherited properties |
|
14.30.1 Property 'collectionElementType'
|
| Description | This property is only relevant if the parameter is a collection. The collection-element-type then defines the types of objects in the collection.
This can be either the concrete class, an abstract class or an interface implemented by objects in the collection.
The value can also be the name of a class known to JeeWiz. In this case, the object-passing-style property can be used to define how the value is to be passed.
|
| Type | String |
| Default | \null |
14.30.2 Property 'objectPassingStyle'
|
| Description | The object-passing-style applies to parameters on a method, where the specified parameter type is the name of a business object defined in JeeWiz.
JeeWiz can automatically generate interfaces and classes based on a main class, so there are different ways that an object can be passed.
To consider concrete cases from EJB:
- Cancelling a customer order:
Customer.cancelOrder( Order o )
- Cancelling the order identified by a primary key:
Customer.cancelOrder( OrderPK opk )
- Creating an order:
Order.createOrder( OrderValueObject ovo )
These are all cases where the parameter would simply be modelled as an order, but following analysis of the object interactions, it is clear that one of the more specialised types is relevant.
Adding the object-passing-style allows JeeWiz to generate the correct code for the scenario.
The default value for object-passing-style, "object", causes JeeWiz to put the appropriate representation of the object type in the parameter call (and in any generated proxies).
Example 1 above demonstrates this case.
If the model that does the rendering is creating purely local objects, then the bare class name will be used as shown above.
If the business object is being exposed by a local interface, then local interface reference types will be generated
e.g. Customer.cancelOrder( OrderLocal o ).
If the business object is being exposed by a remote interface, then remote interface reference types will be generated (e.g. CustomerRemote).
Other options are:
- 'pk' - pass the primary key class (the identity class) of an entity. This is not valid for sessions.
For the EJB rendering, this will be the defined PrimaryKey class.
This is shown in example 2 above, where 'OrderPK' is the primary key class for Order.
- 'value' - pass the value object type generated from this class.
This requires that the value object is created for the class.
This is shown in example 3 above, where 'OrderValueObject' is the generated value object class for Order.
How exactly these get rendered into code is dependent on the model. These facilities can be use as tagged values in model
The reason for defining object passing styles is so that this mapping can be defined in the design.
It would be possible to enter the end-class (e.g. OrderValueObject), but this would then not be portable to other environments or corporation standards for names.
Note that we don't support the concept of a handle, but this could be a local enhancement.
|
| Type | String |
| Choices |
object (default)
pk
value
|
| Default | object |
14.30.3 Property 'text'
|
14.30.4 Property 'goodValue'
|
| Description | An acceptable value for this parameter, when used in the encompassing business method
|
| Type | String |
14.30.5 Property 'badValue'
|
| Description | An unacceptable value for this parameter, when used in the encompassing business method
|
| Type | String |
14.30.6 Property 'uid'
|
| Description | The 'uid' is a Unique IDentifier for a methods in the business object model (and derivatives like J2EE).
The 'uid' uniquely identifies the method, even if the name or signature of the method changes.
This will normally be generated by the modelling tool; if not, it can be entered manually (but make sure it is unique!).
|
| Type | String |
Copyright (c) 2001-2008 New Technology/enterprise Ltd.
| |