« Mapping complex objects to XML: Cyclic reference problems | Main | Automatic adaption to Web service changes »
May 31, 2006
Independent mapping of methods and parameters
How are Java methods and parameters mapped to be included in a SOAP message (e.g. when calling a remote procedure of a Web service)?
Maybe like this:
public interface HelloWorld{
public void sayHello(String name); }
is mapped to
<sayHello>
<name>Tom Sawyer</name>
</sayHello>
Problems occur if method name or parameter names are changed (either on consumer or provider side). The names won't match anymore.
My idea to solve this: Make the mapping of names independent from the names used in the programming language. This is achieved using meta-data for method and parameter names (annotations in Java). This may look like this:
public interface HelloWorld{
public void
@methodAnnot(methodName="helloThere")
sayHello(
@paramAnnot(paramName="nameOfGuy") String name); }
that would be mapped to
<helloThere>
<nameOfGuy>Tom Sawyer</nameOfGuy>
</helloThere>
Now you are independent of names in the programming language, i.e. you can change sayHello
or name
to anything you want as long as the annotations are not changed.
Posted by Dominik Marks at May 31, 2006 12:29 PM
Comments
You may want to follow these links: http://www.innoq.com/blog/st/2005/02/13/indigo_programming.html
Posted by: Stefan Tilkov at May 31, 2006 4:22 PM