• Post Reply Bookmark Topic Watch Topic
  • New Topic

document style versus procedural style?  RSS feed

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I know that RPC style means you have an intuitive message instance that is easy to read and that document style offers some advantages regarding validation.

However taking a step back and looking at from a higher level what's the difference.

Let's say you have a web service which has to accept membership application forms.
The forms can contain many different permutation of many different fields.

Does an RPC approach mean you have one method with lots of parameters - one for each field? And a document approach mean you only have one parameter: the document. And the document wraps all the fields?

so can we say a document approach makes more sense when you have a lot of parameters that would be nice to wrap and a rpc approach makes sense when you have lots of methods with very few parameters?

I'm interesting in your opinions!

 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Luke,

I have to agree that, I'm also one of those who gets confused between RPC vs Document style quite often. But upon lot of discussions and readings, I came to a conclusion that, Document style is more benefited when you have a huge document that can be validated against some schemas and may take a longer time to process. Not necessarily asynchronous, but yes, it may involve lot of validations, parsing etc. This kind of service invocation is applicable in the example you quoted below, where you need to validate the application form against several xsds etc.

On the other hand, RPC is more of quick operations.... say calculator (may not be a good example) but the underlying principle here is use RPC if you think that operation is quick and does not involve lot of validations against the validity of the incoming SOAP request on the other hand, use Document, if you need validation against schemas for enforcing business rules.

I think this may be the reason why Document style is preferred over RPC in SOAP based WS, as usual business usecases are B2B transactions, which involves lot of business rules to be validated before processing the request.

But I believe, this confusion would still continue for me too
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!