JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   14.  'Business Object' Reference
 


14.30 Parameter Object

Used on
method
query
Superclassjava: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
name from java:namedValue.name

description from java:parameter.description

template (base property)

jwpattern (base property)

type from java:namedValue.type

final from java:parameter.final

 14.30.1  Property 'collectionElementType'
 14.30.2  Property 'objectPassingStyle'
 14.30.3  Property 'text'
 14.30.4  Property 'goodValue'
 14.30.5  Property 'badValue'
 14.30.6  Property 'uid'

14.30.1  Property 'collectionElementType'
DescriptionThis 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.
TypeString
Default\null

14.30.2  Property 'objectPassingStyle'
DescriptionThe 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:
  1. Cancelling a customer order: Customer.cancelOrder( Order o )
  2. Cancelling the order identified by a primary key: Customer.cancelOrder( OrderPK opk )
  3. 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.
TypeString
Choices object (default)
pk
value
Defaultobject

14.30.3  Property 'text'
TypeString
Hiddentrue

14.30.4  Property 'goodValue'
DescriptionAn acceptable value for this parameter, when used in the encompassing business method
TypeString

14.30.5  Property 'badValue'
DescriptionAn unacceptable value for this parameter, when used in the encompassing business method
TypeString

14.30.6  Property 'uid'
DescriptionThe '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!).
TypeString
 


Copyright (c) 2001-2008 New Technology/enterprise Ltd.