JeeWiz Home  
The Model-Driven System Builder

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


14.25 InternalClass Object

Superclassjava:jwclass
Subclassed By
baseView
businessObject
DescriptionThe Business Object Model's internal-class extends the objectModel's jwclass by containing

  • constraints
  • the BOM versions of field and method (which override and hide the Java meta-model versions).
The reason why we have separate fields and methods is so that they can have lists of constraints too.

The internal-class is intended for internal implementation classes.

It produces a base and implementation file, with the implementation file being user-editable.

The base contains all the boilerplate code for all methods. The base methods call out to the implementation class's method if there is no implementation code defined in the base. The implementation class derives from the base class, which is abstract. Therefore the implementation class should be instantiated to use the pair.

Don't use internal-class where external access is desired. Classes that are intended for external use should be business-objects or one of its specialisations, like entity or session. Business-objects automatically create factory and business interface classes, whereas the internal-class does not.
ImplementsBusinessClassSpec
Contained
Lists
1
Name  typeParameter
Type  java:typeParameter
Inherited from  java:referenceType
 
2
Name  import
Type  String
Inherited from  java:referenceType
 
3
Name  field
Type  java:field
Description  The list of fields and attributes for this internal class.
Previous Model  java:field
Indexed property  name
 
4
Name  method
Type  java:method
Description  The list of methods and business-methods for this internal class.
Previous Model  java:method
Indexed property  name
 
5
Name  implements
Type  String
Inherited from  java:jwclass
 
6
Name  constraint
Type  constraint
Description  Constraints for this business object.
GenerateAllList  false
 
7
Name  style
Type  String
Description  You can specify one or more styles to give information to the code generation scripts. The meaning of the styles is up to the script writer.

The styles can be used as flags by the script calling $styleList.contains( "styleOfInterest" )

[ Currently, there is no built-in support for style="styleType=value" type semantics. This would have to be defined by each script writer. ]

Examples of the use of styles:
  • characteristics of a web page (e.g. should it be included in one of the menus)
  • whether an entity should be automatically mapped to a data-view (the 'maintain' style).
Note that styles and the 'group' property are different concepts, and therefore complimentary. Many modelling objects - such as data-views and their fields, or business methods - can be put into groups as a hint as to where to render the UI pages. Typically groups are used to define 'where' to place the meta class, whereas styles indicate how to render the object.
Unique  false
Inherited
properties
name from java:referenceType.name

description from java:interfaceMethod.description

template from java:interfaceMethod.template

text from java:method.text

jwpattern (base property)

typeDeclaration from java:referenceType.typeDeclaration

extends from java:referenceType.extends

headerComment from java:referenceType.headerComment

customerHeaderComment from java:referenceType.customerHeaderComment

package from baseViewRelation.package

generateLogLevel from constraint.generateLogLevel

access from java:interface.access

annotation from java:interfaceMethod.annotation

abstract from java:method.abstract

static from java:method.static

serializable from java:jwclass.serializable

final from java:method.final

 14.25.1  Property 'alwaysGenerateTriggers'
 14.25.2  Property 'constraintExceptionType'
 14.25.3  Property 'uid'
 14.25.4  Property 'group'
 14.25.5  Property 'userNameBase'

14.25.1  Property 'alwaysGenerateTriggers'
DescriptionPrimarily for product manufacturers who want to always have override facilities available on an implementation class when they arrive on site, whether or not this is specified in the model
Typeboolean
Delegatestrue

14.25.2  Property 'constraintExceptionType'
DescriptionThe constraintExceptionType is the type of the exception which is thrown if the constraint fails.

It can be any valid class name - probably defined by a 'jwclass'. It could be, for example, a specific class of business exception which should be thrown for this constraint.

If this is not in the same package as the build module (e.g. in the EJB Jar or Ear), then the name should be qualified by the package name.

The constraintExceptionType is available on constraints, objects and assemblies, and can also be set in the top level properties build file (e.g. build.jwp).

Because this is a delegated property, the actual value used is whichever instance is encountered first, working up from the validation object. This means it is very easy to specialise the exceptions thrown in part of the specification tree (e.g. one session EJB), leaving the rest unchanged.

Failing any value at all, 'RuntimeException' is used ... but clearly this should not be used in production systems.
TypeString
Delegatestrue

14.25.3  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

14.25.4  Property 'group'
DescriptionA group is a hint to generation scripts as to where to place this object.

It provides an alternative, more flexbile way of grouping business-methods, objects, data-views and pages.

For example, pages for data-maintenance might be in the "DataMaintenance" group, while specially-designed sessions might be in the "BusinessFunctions" group. (Expressing this grouping cannot be derived from the hierarchy: all pages are children of a single application.)

Another usage could be to group fields for presentation based on their group name.

The 'group' property should be used to guide presentation to the user, whereas 'style' should be used to guide further pattern generation.

The 'default' group is the null value (script writers must use '#if( !$group )' to identify the default group.
TypeString

14.25.5  Property 'userNameBase'
DescriptionThis is the user-visible name for this object (currently it is used on business objects, business-methods and data-views.

In the standard rendering, this is further embellished in component.properties to create the userName, which the user will actually see.

For example, say the name of a session object is AccountTransaction. Then the default for the user-name-base will be 'Account Transaction'. This will be embellished in component.properties to give the userName 'Account Transactions'.

Either the userNameBase or the userName can then be used in scripts.
TypeString
 


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