what best use defining soap use (generic vs. specific operation)?
my conditions follows:
i have normalized database, i reason geographic information airports. structure is:
airport --is in--> city --is in--> republic --is in--> continent
now i wish let users administrate data, but giving proceed opening database. need offer administration interface around web service.
now, comes conceptualizing service, ran contention interpretation operations. came adult opposite solutions:
solution a: specific operations
for any 4 tables (airport, city, country, continent) interpretation 3 operations:
- insert
- get
- update
this lead 12 operations 2 request/response objects = 24 objects
to emanate an new airfield dependencies, during slightest 4 requests necessary.
solution b: generic
there wholly operation, tranquil around parameters. operation able formulating all indispensable discharge database.
the operation endorse needs finished executes it. an blunder occures, play behind everything.
==> 1 operation = 2 rarely challenging request/response-objects
solution c: accommodate center 1
one general operation per table, able executing get, insert, update, only fortitude b, nonetheless focused list each.
==> 4 operations = 8 challenging request/response-objects
solution d: accommodate center 2
one general operation per movement (get, insert, delete), work any list solve dependencies.
==> 3 operations = 6 rather some-more challenging request/response-objects
example
since rather abstract, hier simplified instance request-objects formulating (jfk/new york/usa/north america):
solution a:
request 1/4:
<insertcontinent>north america</insertcontinent>
request 2/4:
<insertcountry continent="north america">usa</insertcountry>
request 3/4:
<insertcity country="usa">new york</insertcity>
request 4/4:
<insertairport city="new york">jfk</insertairport>
solution b:
request 1/1:
<action type="insertcountry" parent="north america">usa</action>
<action type="insertairport" parent="new york">jfk</action>
<action type="insertcontinent" parent="">north america</action>
<action type="insertcity" parent="usa">new york</action>
solution c:
request 1/4:
<countryaction type="insert" parent="north america">usa</countryaction>
request 2/4:
<airportaction type="insert" parent="new york">jfk</airportaction>
request 3/4:
<continentaction type="insert" parent="">north america</continentaction >
request 4/4:
<cityaction type="insert" parent="usa">new york</cityaction >
solution d:
request 1/1:
<insert airport="jfk" city="new york" country="usa" continent="north america" />
solution d seems rather glorious me, therefore i attempted put xsd:
code:
<complextype name="newcontinent">
<sequence>
<element name="name" type="string"></element>
</sequence>
</complextype>
<complextype name="newcountry">
<sequence>
<element name="isocode" type="string"></element>
<element name="name" type="string"></element>
<choice>
<element name="newcontinent" type="tns:newcontinent"></element>
<element name="continent" type="string"></element>
</choice>
</sequence>
</complextype>
<complextype name="newcity">
<sequence>
<element name="iata" type="string"></element>
<element name="name" type="string"></element>
<choice>
<element name="country" type="string"></element>
<element name="newcountry" type="tns:newcountry"></element>
</choice>
</sequence>
</complextype>
<complextype name="newairport">
<sequence>
<element name="iata" type="string"></element>
<element name="name" type="string"></element>
<choice>
<element name="city" type="string"></element>
<element name="newcity" type="tns:newcity"></element>
</choice>
</sequence>
</complextype>
a analogous ask following feeling follows:
<complextype name="request">
<choice>
<element name="airport" type="tns:newairport"></element>
<element name="city" type="tns:newcity"></element>
<element name="country" type="tns:newcountry"></element>
<element name="continent" type="tns:newcontinent"></element>
</choice>
</complextype>
now question: is unequivocally best fortitude available? xsd adequate understand, going on?
Comments
Post a Comment