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.
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 |
<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
to apply a blotter vieworg.Foo foo = new Foo ();
foo.setName ("Bar");
org.FooBlotterView b = foo.createBlotterView ();
For inheritence use the same format name (in this case 'blotter')..org.FooBlotterView in = new FooBlotterView ();
in.setName ("Bob");
.... pass through some messaging/queueing
foo.initializeFromView (in);
<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.