class-view

Description

Define a data abstraction for a class. Useful for passing collections of objects to a display layer where only 9 of 100 fields are needed, also if a message or user entry is 20 of 100 fields, one can create an entry-view which can be applied to a new or existing full class. Views are given an alias for use inside the <view> node. Views can have inheritance to mimic the inheritance structure of the full-classes which are handled by using the same alias. (see Examples) Found inside class nodes.

Parameters

Attribute Description Required
name a fully-qualified Java class name (different from full-class) to wrap this abstraction. Yes
format an alias name like 'blotter' for later use

Parameters specified as nested elements

NONE

Examples

  
<class name="org.Foo" >
  <class-view name="org.FooBlotterView" format="blotter"/>
  <field name="name" type="string">
    <view in="blotter" />
  </field>
  ... more fields with no view tag..
</class>
to make a blotter view call
org.Foo foo = new Foo ();
foo.setName ("Bar");   
org.FooBlotterView b = foo.createBlotterView ();
to apply a blotter view
org.FooBlotterView in = new FooBlotterView ();
in.setName ("Bob");
....  pass through some messaging/queueing
foo.initializeFromView (in); 
For inheritence use the same format name (in this case 'blotter')..
  
<class name="org.Bar" extends="org.Foo">
  <class-view name="org.BarBlotterView" format="blotter"/>
  <field name="favoriteTeam" type="string">
    <view in="blotter" />
  </field>
  ... more fields with no view tag..
</class>
Now Class BarBlotterView will extend FooBlotterView and contain the extra field "favoriteTeam"

Copyright © 2000,2001,2002 Paul Bethe and Richie Bielak. All rights Reserved.