it could be an option, however I would prefer to separate protocol request state from
protocol request meta data.
On example is that the type of a request is a meta data and I want rather to use a design
which use annotations.
| public abstract class UIRequest implements Serializable { ... }
|
| @type("MoveWindow")
| public class SomeRequest extends UIRequest { ... }
|
It is useful to put annotations on the protocol elements. We will certainly have other
meta data that describes the behavior of a protocol request.
For instance if you look at the command framework today in core it has the same notion of
meta data but it is implemented using java and not annotations.
And the few metadata present on the controller command drive the behavior of the execution
of the command at runtime.
| public class ControllerCommand
| {
| ...
| /** Return the meta data of this command. */
| public abstract CommandInfo getInfo();
| ...
| }
|
There are also other valid points that makes me prefer a hierarchy over an objects that
aggregates all:
- easier to debug
- easier to categorize
- inheritance and polymorphism can be leveraged
"sohil.shah(a)jboss.com" wrote : The protocol needs to be modelled under the form
of a hierarchy of serializable objects.
|
| What do you think of a more flexible object model with a leaner hierarchy...
|
| Something like this:
|
|
| | public class UIRequest implements Serializable
| | {
| | private String requestType; //this signifies what type of function is asked
for like
| | getUIElement, processURL, moveWindow, removeWindow
| |
| | private Map attributes; //this contains the data needed for a particular
function
| | }
| |
|
| Something similar for UIResponse as well.
|
| This way more functions can probably be integrated into the system pretty easily as
well.
|
| This would help to evolve the UIServer functionality over time while still keeping it
lean and mean
|
| btw- Now that we want to integrate at the second phase of the controller, a well
thought out object model becomes very important
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061341#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...