S
sunshine
Hi Folks,
Not sure whether this question is in any way related to lack of
caffiene in my blood, so I leave it upto you guys to decide.
I have a UI that has a simple Table - User can create one, modify one
by adding/deleting rows and columns, rename columns etc.
All these User actions get funneled down to a Servlet that accepts
these requests and ferries them across to a DataProvider. The actions
are passed into the Servlet [and hence to the back-end library] as XML
Commands.
The DataProvider would need to interpret these commands and exercise
them on the Object Model. The Object model would then be persisted in
some repository.
For instance, a command to create a table would be
<createTable name="personalInfo">
..........
..........
..........
<insertRow position="10" values="10 20 30 40"/>
<addColumn name="address" type="string" position="5" default="US"/>
<insertRow position="10" values="10 20 30 40 Germany"/>
<renameColumn originalName="address" newName="ResidenceAddress" />
</createTable>
There would be other commands to update a table, delete a table, rename
a table etc. [Note that this is just a sample structure I have shown.
The actual use-case would have more commands and is relatively more
complex in nature. ]
My first questionis: What is the best way to interpret these commands?
Is there any standard around this? I could not equate the Command
pattern with this kind of a scenario.
My second question: Is this command mode the best way to funnel down
changes ? [The other option I had considered was to work off a DOM in
the UI layer. That provied to be a bit more expensive]
Anyway, do I have an option here ? What do you think?
Cheers!
Sunshine.
Not sure whether this question is in any way related to lack of
caffiene in my blood, so I leave it upto you guys to decide.
I have a UI that has a simple Table - User can create one, modify one
by adding/deleting rows and columns, rename columns etc.
All these User actions get funneled down to a Servlet that accepts
these requests and ferries them across to a DataProvider. The actions
are passed into the Servlet [and hence to the back-end library] as XML
Commands.
The DataProvider would need to interpret these commands and exercise
them on the Object Model. The Object model would then be persisted in
some repository.
For instance, a command to create a table would be
<createTable name="personalInfo">
..........
..........
..........
<insertRow position="10" values="10 20 30 40"/>
<addColumn name="address" type="string" position="5" default="US"/>
<insertRow position="10" values="10 20 30 40 Germany"/>
<renameColumn originalName="address" newName="ResidenceAddress" />
</createTable>
There would be other commands to update a table, delete a table, rename
a table etc. [Note that this is just a sample structure I have shown.
The actual use-case would have more commands and is relatively more
complex in nature. ]
My first questionis: What is the best way to interpret these commands?
Is there any standard around this? I could not equate the Command
pattern with this kind of a scenario.
My second question: Is this command mode the best way to funnel down
changes ? [The other option I had considered was to work off a DOM in
the UI layer. That provied to be a bit more expensive]
Anyway, do I have an option here ? What do you think?
Cheers!
Sunshine.