XML Command Interpreter

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.
 
J

jan V

<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.

Hi, I'm neither an XML nor a database expert, but it does look as if you're
trying to reinvent the SQL wheel by turning a lot of core SQL functionality
into XML equivalents. I know a lot of people use XML just and only because
it's the "bandwagon du jour", so would your project possibly suffer from
this problem? (just asking)
 
S

sunshine

Hi,

Actually we are far far from using a database. These rows and columns
do not correspond to those within a database table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,790
Messages
2,569,637
Members
45,346
Latest member
EstebanCoa

Latest Threads

Top