<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Dominik Marks</title>
<link>http://www.innoq.com/blog/dm/</link>
<description></description>
<copyright>Copyright 2009</copyright>
<lastBuildDate>Sun, 10 Sep 2006 15:04:09 +0100</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.31</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>Thesis finished...</title>
<description><![CDATA[<p>I finished my master thesis on the 25th of August.</p>

<p>I'd like to thank all people who helped me with the thesis by providing comments to this blog and other information.<br />
</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/09/thesis_finished.html</link>
<guid>http://www.innoq.com/blog/dm/2006/09/thesis_finished.html</guid>
<category></category>
<pubDate>Sun, 10 Sep 2006 15:04:09 +0100</pubDate>
</item>
<item>
<title>Self-describing ontology</title>
<description><![CDATA[<p>I was thinking about what happens if a service changes and what may help to improve that situation.</p>

<p>A special case is the evolution of complex objects. The type of an object needs to be declared and needs to be known on both sides of interacting partners. </p>

<p>I found a more flexible approach using a <a href="http://www.manageability.org/blog/archive/20021122%23grand_unified_theory_of_loose">self-describing ontology</a>. This means the object type is described by meta data which is exchanged between the partners, too. By this the object type may change and the change is automatically transferred. </p>

<p>Both partners need to be able to understand this meta data. If they do, objects may change as they like.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/08/selfdescribing.html</link>
<guid>http://www.innoq.com/blog/dm/2006/08/selfdescribing.html</guid>
<category></category>
<pubDate>Fri, 04 Aug 2006 20:56:45 +0100</pubDate>
</item>
<item>
<title>Web service versioning and the consumer does not need to know about...</title>
<description><![CDATA[<p>I <a href="http://www.innoq.com/blog/dm/2006/06/web_service_ver.html">was thinking about</a> how to add a version information to a WSDL description and SOAP messages. I mentioned that <a href="http://www-128.ibm.com/developerworks/webservices/library/ws-version/">Best practices for Web services versioning.</a> e.g. supposes to use different namespaces for different versions. </p>

<p>A simple idea how this can be achieved without using different namespaces and without the need that the consumer needs to know that there is versioning support is the following:</p>

<p>A fixed value is used for the version information. This way the version information automatically filled in every SOAP message and the consumer does not need to care about it. It just uses a certain WSDL description at one point in time, reads that it needs to send a fixed value in every SOAP message and that's it.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/07/web_service_ver_1.html</link>
<guid>http://www.innoq.com/blog/dm/2006/07/web_service_ver_1.html</guid>
<category></category>
<pubDate>Tue, 04 Jul 2006 10:39:11 +0100</pubDate>
</item>
<item>
<title>Convertible and unconvertible Web service changes</title>
<description><![CDATA[<p><a href="http://www.innoq.com/blog/dm/2006/06/web_service_ver.html">I'm thinking about</a> the possibility to convert incoming SOAP messages so that they conform to the current WSDL. Therefore I'd like to list up all possible changes to a message and if these are convertible or not.</p>

<p>My list so far:</p>

<ul>
<li>Changing Operation Name: convertible
<li>Adding an operation: no influence on existing service
<li>Deleting an operation: <b>not convertible</b>
<li>Changing parameter name: convertible
<li>Adding a parameter: convertible (use default value)
<li>Deleting a parameter: <b>not convertible</b>
<li>Combining parameters to a complex object (or other way round): convertible </b>
<li>Changing parameter order: convertible (or no influence?)
<li>Changing data types of parameters (simple data types, complex objects, hierarchy or not?): may be possible to convert for simple data types and objects in a hierarchy
<li>Changing return data type: same as above
</ul>

<p>You can think of the XML elements on their own, too:</p>

<ul>
<li>Renaming an element: convertible
<li>Adding an element: convertible (default value)
<li>Deleting an element: <b>not convertible</b>
<li>Changing from element to attribute (and other way round): convertible
<li>Moving a node up or down in the XML tree: convertible
</ul>

<p>Can you think of other changes? I have to think of how convertible parts can be converted (something like mapping functions).</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/06/convertable_and.html</link>
<guid>http://www.innoq.com/blog/dm/2006/06/convertable_and.html</guid>
<category></category>
<pubDate>Mon, 19 Jun 2006 11:59:34 +0100</pubDate>
</item>
<item>
<title>Web service versioning</title>
<description><![CDATA[<p>There are several approaches to allow Web service versioning. </p>

<p>My idea:</p>

<p>If a consumer sends a SOAP message to the provider that conforms to an earlier version of a WSDL than the current one it may be not accepted by the Web service stack.</p>

<p>It should be possible to create an interceptor/proxy that is aware of the old and the new WSDL (and knows how to convert from old to new messages). The old message (which is not conform to the current WSDL) is converted (maybe XSLT is a good choice) to a new message that conforms to the current WSDL and then it is send to the service.</p>

<p><br />
The part I am not sure about is how the WSDL and a SOAP message can be labelled with a version information. Some possibilities are stated  in <a href="http://www-128.ibm.com/developerworks/webservices/library/ws-version/">Best practices for Web services versioning</a>. </p>

<p>It is possible to use a new target namespace for the WSDL, but all data is changed to the new namespace this way. Another possibility is to use a version-aware UDDI registry.</p>

<p><br />
It would be fine if the WSDL had a version field. Maybe it is possible to define a version information somewhere in the WSDL. The SOAP message may be labelled with a version information in a SOAP header...</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/06/web_service_ver.html</link>
<guid>http://www.innoq.com/blog/dm/2006/06/web_service_ver.html</guid>
<category></category>
<pubDate>Mon, 12 Jun 2006 09:53:21 +0100</pubDate>
</item>
<item>
<title>Uncommon idea for consumer proxies</title>
<description><![CDATA[<p>RPC-style communication use proxies to hide the communication between Web service consumer and provider. Here is another idea how to use a proxy on consumer side. For this idea the consumer doesn't even have to know that there is a proxy.</p>

<p>Sample main program:<br />
<code><br />
public&nbsp;class&nbsp;Test{<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;@WebService<br />
&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;sayHello(String&nbsp;name)&nbsp;{&nbsp;}<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;main(String&nbsp;args[])<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;sayHello("Tom&nbsp;Sawyer");<br />
&nbsp;&nbsp;}<br />
}  </code></p>

<p>You think this does nothing, right? Correct! But it works using an aspect:</p>

<p><code><br />
public&nbsp;aspect&nbsp;TestAspect&nbsp;{<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;pointcut&nbsp;execWebService()&nbsp;:&nbsp;execution(@WebService&nbsp;*&nbsp;*&nbsp;(..));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;Object&nbsp;around():&nbsp;execWebService()&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;//Handle&nbsp;request&nbsp;and&nbsp;send&nbsp;SOAP&nbsp;message...<br />
&nbsp;&nbsp;}<br />
} </code></p>

<p>This way the request is handled by the aspect. </p>

<p>This is just an uncommon idea of a Web service proxy. The developers of the consumer don't have to know about proxies. They may wonder about the empty Web service method in the main class, only.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/06/uncommon_idea_f.html</link>
<guid>http://www.innoq.com/blog/dm/2006/06/uncommon_idea_f.html</guid>
<category></category>
<pubDate>Thu, 08 Jun 2006 09:32:22 +0100</pubDate>
</item>
<item>
<title>Is void a data type?</title>
<description><![CDATA[<p>Found an <a href="http://groups.google.de/group/comp.lang.java.programmer/browse_thread/thread/2c99ee31d264e491/2072f223e7f3db49?lnk=st&q=java+%22return+void%22&rnum=2&hl=de#2072f223e7f3db49">interesting discussion</a> about if Java <code>void</code> is a data type or not. </p>

<p>Why would someone need to return <code>void</code> as return value? If there is no return value, you may return <code>null</code> or declare the method <code>void</code> instead of trying to return <code>void</code>.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/06/is_void_a_data.html</link>
<guid>http://www.innoq.com/blog/dm/2006/06/is_void_a_data.html</guid>
<category></category>
<pubDate>Wed, 07 Jun 2006 12:10:12 +0100</pubDate>
</item>
<item>
<title>Automatic adaption to Web service changes</title>
<description><![CDATA[<p>I'm just brainstorming about a new concept in the Web service area.</p>

<p>The idea is that a service consumer is changed automatically if the Web service itself changes. At first, I'd like to look at simple examples, like changing a method name or changing the return type to void. </p>

<p>For example this would mean that if a method of the service is changed from <code>public void hello();</code> to <code>public void helloWorld();</code> the consumer is changed to <code>helloWorld()</code>, too (i.e. the SOAP message contains the new method name). </p>

<p>This is the idea. I'm not sure how to implement this idea, yet.</p>

<p>Here are some things I thought of:</p>

<ul>
<li>Using aspect-oriented programming (good tutorial <a href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html">here</a>). But I don't know yet, how to use it to automatically change the consumer...
<li>I tried to use Java 5 Instrumentation, too (tutorial <a href="http://www.javalobby.org/java/forums/t19309.html">part 1</a>, 
<a href="http://www.javalobby.org/java/forums/m91837350.html">part 2</a>). But this seems to be very complicated, because you need to work directly on the byte code. 
</ul>

<p>I have to think about what needs to be changed on consumer side. I don't think that you have to change the consumer classes directly, but the SOAP message that is sent, only. </p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/06/automatic_adapt.html</link>
<guid>http://www.innoq.com/blog/dm/2006/06/automatic_adapt.html</guid>
<category></category>
<pubDate>Tue, 06 Jun 2006 10:27:30 +0100</pubDate>
</item>
<item>
<title>Independent mapping of methods and parameters</title>
<description><![CDATA[<p>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)?</p>

<p>Maybe like this:</p>

<p><code><br />
public interface HelloWorld{<br />
&nbsp;&nbsp;public void sayHello(String name); }  <br />
</code></p>

<p>is mapped to</p>

<p><code><br />
&lt;sayHello&gt;<br />
&nbsp;&nbsp;&lt;name&gt;Tom&nbsp;Sawyer&lt;/name&gt;<br />
&lt;/sayHello&gt;<br />
</code></p>

<p>Problems occur if method name or parameter names are changed (either on consumer or provider side). The names won't match anymore.</p>

<p>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:</p>

<p><code><br />
public interface HelloWorld{<br />
&nbsp;&nbsp;public void <br />
&nbsp;&nbsp;&nbsp;&nbsp;@methodAnnot(methodName="helloThere")<br />
&nbsp;&nbsp;&nbsp;&nbsp;sayHello(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@paramAnnot(paramName="nameOfGuy") String name); }  <br />
</code></p>

<p>that would be mapped to</p>

<p><code><br />
&lt;helloThere&gt;<br />
&nbsp;&nbsp;&lt;nameOfGuy&gt;Tom&nbsp;Sawyer&lt;/nameOfGuy&gt;<br />
&lt;/helloThere&gt;<br />
</code></p>

<p>Now you are independent of names in the programming language, i.e. you can change <code>sayHello</code> or <code>name</code> to anything  you want as long as the annotations are not changed.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/05/independent_map.html</link>
<guid>http://www.innoq.com/blog/dm/2006/05/independent_map.html</guid>
<category></category>
<pubDate>Wed, 31 May 2006 12:29:44 +0100</pubDate>
</item>
<item>
<title>Mapping complex objects to XML: Cyclic reference problems</title>
<description><![CDATA[<p>I'm trying to map complex objects to XML to be able to transfer the object data from a client to a Web service. The data fields are transferred only, i.e. the object is mapped and not serialized (like Java serialization).</p>

<p>Mapping simple data type fields is easy. Mapping references to other objects is done by including the referenced object as child XML nodes.</p>

<p>A simple example (simplified version, better would be getter/setter methods):</p>

<p><code><br />
public class Person{<br />
&nbsp;&nbsp;public String name;<br />
&nbsp;&nbsp;public Person relatedTo;<br />
}<br />
</code></p>

<p>A person with a reference to another person could be mapped like this:</p>

<p><code><br />
&nbsp;&lt;person&gt;<br />
&nbsp;&nbsp;&lt;name&gt;Donald&lt;/name&gt;<br />
&nbsp;&nbsp;&lt;relatedTo&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;person&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;Daisy&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;relatedTo /&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/person&gt;<br />
&nbsp;&nbsp;&lt;/relatedTo&gt;<br />
&nbsp;&lt;/person&gt; <br />
</code></p>

<p>So Donald is related to Daisy, but Daisy not related to Donald. If the inclusion process is continued, it would cause problems if Daisy is related to Donald, too. These are cyclic references and this way of mapping would include Donald in Daisy and Daisy in Donald continuing unlimitedly. There needs to be another way of mapping cyclic references.</p>

<p>A possible solution:</p>

<ul>
<li>Each object is added to an Object Hashtable and gets an ID
<li>If a reference to an object should be mapped, the object is
looked up in the Hashtable.
<li>If the object is found, a reference to the ID is mapped only.
</ul>

<p>The same mapping with Donald related to Daisy and the other way round looks like this:</p>

<p><code><br />
&nbsp;&lt;person id="1"&gt;<br />
&nbsp;&nbsp;&lt;name&gt;Donald&lt;/name&gt;<br />
&nbsp;&nbsp;&lt;relatedTo&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;person id="2"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;Daisy&lt;/name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;relatedTo ref="1" /&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/person&gt;<br />
&nbsp;&nbsp;&lt;/relatedTo&gt;<br />
&nbsp;&lt;/person&gt; <br />
</code></p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/05/mapping_complex.html</link>
<guid>http://www.innoq.com/blog/dm/2006/05/mapping_complex.html</guid>
<category></category>
<pubDate>Fri, 26 May 2006 14:42:40 +0100</pubDate>
</item>
<item>
<title>Annotation Inheritance</title>
<description><![CDATA[<p>According to <a href="http://www.jcp.org/en/jsr/detail?id=175">JSR-175</a> annotations are <b>not</b> inherited in a class hierarchy, i.e.</p>

<p><code><br />
class Person{<br />
&nbsp;&nbsp;@Annotation public String getName() { ... }<br />
}<br />
</code></p>

<p>has an annotated method getName() but for</p>

<p><code><br />
class ExtendedPerson extends Person{<br />
&nbsp;&nbsp;public String getName() { ... }<br />
}<br />
</code></p>

<p>getName() is not annotated.</p>

<p><br />
I found a blog entry that describes this problem, too. It is called <a href="http://beust.com/weblog/archives/000250.html">Annotation Design Patterns</a>. A comment in this blog supposes to use the <code>@Inherited</code> meta-annotation when the annotation is defined, but I found no difference between using this meta-annotation or without using it. The annotation on the method is not inherited. I tried to use the meta-anntotation <code>@Override</code> for the method, too, but no difference at all.</p>

<p><br />
Of course, if the method is not overridden in the child class the annotation is present, because the method of the parent class is used (which is annotated).</p>

<p>It is not a big problem that annotations are not inherited, but it would be easier if the annotations would not need to be repeated everytime.</p>

<p>Is there a better way to inherit annotations or it is not possible at all?</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/05/annotation_inhe.html</link>
<guid>http://www.innoq.com/blog/dm/2006/05/annotation_inhe.html</guid>
<category></category>
<pubDate>Thu, 25 May 2006 10:20:42 +0100</pubDate>
</item>
<item>
<title>More flexibility for Web services using dynamic proxies</title>
<description><![CDATA[<p>The normal Web services tools generate static stubs and ties for RPC style programming. Every time the service is changed these stubs and ties need to be regenerated. </p>

<p>I tried a first approach to loosen this problem using dynamic proxies. For that I wrote a proxy myself that is based on <a href="http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html">Java 1.3 dynamic proxies</a>.</p>

<p>The advantage is that the remote procedure call is as easy as before <b>and</b> it is possible to change the service without the need to regenerate the stubs and ties. In this case changing the service means that both sender and receiver are changed in the same way.</p>

<p>Nevertheless if sender and receiver have different method interfaces (e.g. the sender thinks the method is <code>void helloWorld(String name)</code> and the receiver's implementation uses <code>void helloWorld(String name, int age)</code> the dynamic proxy approach fails, too (i.e. <a href="http://www.innoq.com/blog/dm/2006/03/changing_interf_1.html">same RPC problems occur as described earlier</a>).</p>

<p>If the service is changed and all service consumer get the new method interfaces there is no need to regenerate the stubs and ties anymore.</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/05/more_flexibilit.html</link>
<guid>http://www.innoq.com/blog/dm/2006/05/more_flexibilit.html</guid>
<category></category>
<pubDate>Sat, 13 May 2006 12:35:34 +0100</pubDate>
</item>
<item>
<title>Intelligent proxies</title>
<description><![CDATA[<p>I found an interesting article about dynamic proxies. It is called <a href="http://www.tobject.de/uploads/media/javamagazin_dynamicproxies.pdf">"Praktische Anwendungsszenarien des Dynamic Proxy API"</a>.</p>

<p>The article mentions that dynamic proxies are an advantages for Web services/SOAP, too, because there are no additional stubs that need to be generated but there is a dynamic proxy for everything. </p>

<p>I didn't read the article completely, yet. May this be a way to implement the suggested second concept of "intelligent proxies" for my master thesis?</p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/05/intelligent_pro.html</link>
<guid>http://www.innoq.com/blog/dm/2006/05/intelligent_pro.html</guid>
<category></category>
<pubDate>Mon, 01 May 2006 11:16:17 +0100</pubDate>
</item>
<item>
<title>XPath and default namespaces</title>
<description><![CDATA[<p>Using default namespaces in XPath expressions seems to be a little bit complicated. The following code excerpt shows the problem:</p>

<p><code><br />
public static void main(String[] args) throws Exception <br />
{<br />
&nbsp;DocumentBuilderFactory documentBuilderFactory =   DocumentBuilderFactory.newInstance();<br />
&nbsp;documentBuilderFactory.setNamespaceAware(true);<br />
&nbsp;DocumentBuilder documentBuilder =  documentBuilderFactory.newDocumentBuilder();<br />
&nbsp;XPath xPath = XPathFactory.newInstance().newXPath();<br />
&nbsp;Document doc = documentBuilder.parse(new File("C:/test.xml"));<br />
&nbsp;Node node =(Node) xPath.evaluate("/address", doc, XPathConstants.NODE);<br />
&nbsp;System.out.println(node);<br />
}<br />
</code></p>

<p>The corresponding XML file looks like this:</p>

<p><code><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;address xmlns="http://wsiftypes.addressbook/" /&gt;<br />
</code></p>

<p>On the first view the XPath expression "/address" should match the root element "address" of the XML document. But this does not work. The resulting node is "null".</p>

<p>The element "address" is assigned to the namespace "http://wsiftypes.addressbook/" and must be used in the XPath expression. Because it is not possible to map this namespace to an empty prefix it must be mapped to a named prefix. </p>

<p>The above code is changed to use an Implementation of the interface NamespaceContext that maps namespaces to prefixes and the other way round. So using the default namespace works like this:</p>

<p><code><br />
public static void main(String[] args) throws Exception <br />
{<br />
&nbsp;DocumentBuilderFactory documentBuilderFactory =   DocumentBuilderFactory.newInstance();<br />
&nbsp;documentBuilderFactory.setNamespaceAware(true);<br />
&nbsp;DocumentBuilder documentBuilder =  documentBuilderFactory.newDocumentBuilder();<br />
&nbsp;XPath xPath = XPathFactory.newInstance().newXPath();<br />
&nbsp;Document doc = documentBuilder.parse(new File("C:/test.xml"));<br />
&nbsp;NamespaceContextImpl nci = new NamespaceContextImpl();      <br />
&nbsp;nci.setNamespaceURI("typens","http://wsiftypes.addressbook/");<br />
&nbsp;xPath.setNamespaceContext(nci);<br />
&nbsp;Node node =(Node) xPath.evaluate("/typens:address", doc, XPathConstants.NODE);<br />
&nbsp;System.out.println(node);<br />
}<br />
</code></p>]]></description>
<link>http://www.innoq.com/blog/dm/2006/04/xpath_and_defau.html</link>
<guid>http://www.innoq.com/blog/dm/2006/04/xpath_and_defau.html</guid>
<category></category>
<pubDate>Fri, 21 Apr 2006 10:35:52 +0100</pubDate>
</item>
<item>
<title>Generating XML files from XML Schema</title>
<description><![CDATA[<p>There are some existing tools that are able to create XML instances from XML Schema definitions. These are (incomplete list):</p>

<ul>
<li><a href="http://www.sun.com/software/xml/developers/instancegenerator/">Sun XML Instance Generator</a> (Supports DTD, RELAX, TREX, Part of XML Schema. Can generate invalid documents, too)
<li><a href="http://xml-xig.sourceforge.net/">XML-XIG</a> (Early stage SourceForge project)
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/xmlgen.asp">Microsoft .NET XmlSampleGenerator</a> (limitations: xs:key, xs:keyref, xs:unique, xs:ENTITY, xs:ENTITIES and xs:NOTATION not supported, incomplete support for xs:pattern and xs:base64Binary)
<li><a href="http://www.altova.com/products_ide.html">Altova XMLSpy </a>(Commercial product)
<li>My own implementation so far (xs:pattern, xs:substitutionGroup, xs:any, xs:anyAttribute, xs:key, xs:keyRef, xs:unique, xs:notation, xs:annotation not supported, yet)]]></description>
<link>http://www.innoq.com/blog/dm/2006/04/generating_xml_1.html</link>
<guid>http://www.innoq.com/blog/dm/2006/04/generating_xml_1.html</guid>
<category></category>
<pubDate>Tue, 11 Apr 2006 17:29:28 +0100</pubDate>
</item>


</channel>
</rss>
