<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
>

<channel>
	<title>Solution Hacker &#187; XFire</title>
	<atom:link href="http://www.solutionhacker.com/tag/xfire/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Sun, 05 Feb 2012 00:45:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=486</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>This blog provides solutions for enterpreneurs!</itunes:summary>
	<itunes:author>Solution Hacker</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.solutionhacker.com/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:subtitle>This blog provides solutions for enterpreneurs!</itunes:subtitle>
	<image>
		<title>Solution Hacker &#187; XFire</title>
		<url>http://www.solutionhacker.com/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://www.solutionhacker.com</link>
	</image>
		<item>
		<title>Evolution of XML parsing technologies</title>
		<link>http://www.solutionhacker.com/implement-your-idea/design/evolution-of-xml-parsing-technologies/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/design/evolution-of-xml-parsing-technologies/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 18:35:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[axiom]]></category>
		<category><![CDATA[Axis2]]></category>
		<category><![CDATA[data binding]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[sax]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[StAX]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[XFire]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml parser]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=167</guid>
		<description><![CDATA[<h2>Introduction</h2>
<p>There were 2 main XML parsing technologies few years ago. They were <strong>SAX </strong>and <strong>DOM</strong>.</p>
<ol>
    <li><strong>SAX </strong>is <strong>event-driven</strong> and the events are fired and forget along the xml parsing. <strong>Advantages</strong>: It doesn't need to cache the whole xml document in memory and you don't need to wait til the whole xml been parsed before the first event emitted. <strong>Disadvantages</strong>: It uses <strong>Push API</strong> that holds the control during parsing. So clients cannot control the parsing and it doesn't fit for xml manipulation.</li>
    <li><strong>DOM </strong>is used to convert the xml into object <strong>tree </strong>in memory before manipulation. <strong>Advantages</strong>: Easier to manipulate the xml. <strong>Disadvantages</strong>: Eat up a lot of memory that is not good for documents larger than few MBs in size or in memory constrained environment such as J2ME.</li>
</ol>
<p><strong>Pull API</strong> is a more comfortable alternative for streaming processing of XML. A  pull API is based around the more familiar <strong>iterator design pattern</strong> rather than <strong>observer design pattern</strong>. In a pull API, the client program  asks the parser for the next piece of information rather than the parser telling  the client program when the next datum is available. In a pull API the client  program drives the parser. In a push API the parser drives the client. That leads to the invention of <strong>StAX</strong>.</p>
<p>In this article, I will introduce an new object model from Axis2 named <strong>AXIOM </strong>that uses StAX underneath for xml parsing. With this, xml parsing will cost less memory with better control.<!--more--><!--more--></p>
<p><!--more--></p>
<p><br />
<!-- $absatzheadline_6 HTML{ --></p>
<h2>Evolution of Axis</h2>
<p>One of the first generation SOAP engines,<strong> Apache SOAP</strong>, uses a <strong>DOM-based</strong> object  model internally to represent the XML document, where the XML handling  techniques force the entire XML object model to be built at once. The second  generation <strong>Apache Axis </strong>shifted to <strong>SAX </strong>to avoid keeping the complete information  in the memory. SAX, however, has a major constraint - it is built around a  &#34;<strong>push</strong>&#34; technique, and once the parsing of the XML document starts it cannot be  stopped. To jump over this hurdle, Apache Axis has to record SAX events. So,  effectively, the XML message has to be kept in the memory in the form of SAX  events, thus making Apache Axis yet another memory intensive programming  model.</p>
<p><strong>Axis2 </strong>avoids keeping the complete SOAP message in the memory by  introducing a new Object Model for representing the SOAP message <b>AXIOM</b>.  <a href="http://jaxmag.com/itr/online_artikel/psecom,id,726,nodeid,147.html">AXIOM</a><!-- $absatzheadline_4 HTML{ --> takes a dramatically new approach. Although AXIOM has an  &#34;external&#34; resemblance to DOM, the difference lies in that it <strong>generates objects  only when required</strong>. This <strong>&#34;on-demand building&#34; </strong>feature gives AXIOM the edge  needed to overcome the memory barrier that early SOAP engines failed to pass.</p>
<p>An interesting feature of AXIOM is that it is based on <strong>Pull parsing</strong>. It is  capable of generating pull events from the Object Model that is built. Further,  if the Object Model happens to be half built, AXIOM is capable of shifting to  the underlying pull parser to generate pull events directly from the <strong>stream</strong><!-- $absatzheadline_5 HTML{ -->. The heart of AXIOM is the XML Pull parser since it is the only parsing model  that supports the pausing of the parsing process. AXIOM uses the <strong>Streaming API for XML (StAX),</strong> making it easy to manipulate and  utilizing only a fraction of the memory used by a conventional object model.  Combined with the speed of the <strong>streaming pull parser</strong>, AXIOM pushes Axis2 leaps  ahead of its predecessors in terms of efficiency and speed.</p>
<p><strong>Apart from new parser, Axis2 also has other new add-ons. They are:</strong></p>
<ol>
    <li>Pluggable Data Binding - you can pick and choose JAXB, Castor and XMLBean for xml - java conversion.</li>
    <li>Improved Support for Message-style interaction (RPC vs Message-based)</li>
    <li>Improved handlers</li>
</ol>
<p>The goal of this article is to focus on parsing technology, so I will not discuss in detail the new features on Axis2. If you want to find out more, read <a href="http://www.jaxmag.com/itr/online_artikel/psecom,cur,,_psframe,,linkobject,print_,nocontainer,1_,id,747,nodeid,147.html">this</a>.</p>
<p>&#160;</p>
<h2>Reference</h2>
<p><a href="http://www.xml.com/lpt/a/1287">An Introduction to StAX</a></p>
<p><a href="http://jaxmag.com/itr/online_artikel/psecom,id,726,nodeid,147.html">Fast and lightweight object model for XML</a></p>
<p>&#160;</p>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>There were 2 main XML parsing technologies few years ago. They were <strong>SAX </strong>and <strong>DOM</strong>.</p>
<ol>
<li><strong>SAX </strong>is <strong>event-driven</strong> and the events are fired and forget along the xml parsing. <strong>Advantages</strong>: It doesn&#8217;t need to cache the whole xml document in memory and you don&#8217;t need to wait til the whole xml been parsed before the first event emitted. <strong>Disadvantages</strong>: It uses <strong>Push API</strong> that holds the control during parsing. So clients cannot control the parsing and it doesn&#8217;t fit for xml manipulation.</li>
<li><strong>DOM </strong>is used to convert the xml into object <strong>tree </strong>in memory before manipulation. <strong>Advantages</strong>: Easier to manipulate the xml. <strong>Disadvantages</strong>: Eat up a lot of memory that is not good for documents larger than few MBs in size or in memory constrained environment such as J2ME.</li>
</ol>
<p><strong>Pull API</strong> is a more comfortable alternative for streaming processing of XML. A  pull API is based around the more familiar <strong>iterator design pattern</strong> rather than <strong>observer design pattern</strong>. In a pull API, the client program  asks the parser for the next piece of information rather than the parser telling  the client program when the next datum is available. In a pull API the client  program drives the parser. In a push API the parser drives the client. That leads to the invention of <strong>StAX</strong>.</p>
<p>In this article, I will introduce an new object model from Axis2 named <strong>AXIOM </strong>that uses StAX underneath for xml parsing. With this, xml parsing will cost less memory with better control.<span id="more-167"></span><!--more--></p>
<p><!--more--></p>
<p>
<!-- $absatzheadline_6 HTML{ --></p>
<h2>Evolution of Axis</h2>
<p>One of the first generation SOAP engines,<strong> Apache SOAP</strong>, uses a <strong>DOM-based</strong> object  model internally to represent the XML document, where the XML handling  techniques force the entire XML object model to be built at once. The second  generation <strong>Apache Axis </strong>shifted to <strong>SAX </strong>to avoid keeping the complete information  in the memory. SAX, however, has a major constraint &#8211; it is built around a  &quot;<strong>push</strong>&quot; technique, and once the parsing of the XML document starts it cannot be  stopped. To jump over this hurdle, Apache Axis has to record SAX events. So,  effectively, the XML message has to be kept in the memory in the form of SAX  events, thus making Apache Axis yet another memory intensive programming  model.</p>
<p><strong>Axis2 </strong>avoids keeping the complete SOAP message in the memory by  introducing a new Object Model for representing the SOAP message <b>AXIOM</b>.  <a href="http://jaxmag.com/itr/online_artikel/psecom,id,726,nodeid,147.html">AXIOM</a><!-- $absatzheadline_4 HTML{ --> takes a dramatically new approach. Although AXIOM has an  &quot;external&quot; resemblance to DOM, the difference lies in that it <strong>generates objects  only when required</strong>. This <strong>&quot;on-demand building&quot; </strong>feature gives AXIOM the edge  needed to overcome the memory barrier that early SOAP engines failed to pass.</p>
<p>An interesting feature of AXIOM is that it is based on <strong>Pull parsing</strong>. It is  capable of generating pull events from the Object Model that is built. Further,  if the Object Model happens to be half built, AXIOM is capable of shifting to  the underlying pull parser to generate pull events directly from the <strong>stream</strong><!-- $absatzheadline_5 HTML{ -->. The heart of AXIOM is the XML Pull parser since it is the only parsing model  that supports the pausing of the parsing process. AXIOM uses the <strong>Streaming API for XML (StAX),</strong> making it easy to manipulate and  utilizing only a fraction of the memory used by a conventional object model.  Combined with the speed of the <strong>streaming pull parser</strong>, AXIOM pushes Axis2 leaps  ahead of its predecessors in terms of efficiency and speed.</p>
<p><strong>Apart from new parser, Axis2 also has other new add-ons. They are:</strong></p>
<ol>
<li>Pluggable Data Binding &#8211; you can pick and choose JAXB, Castor and XMLBean for xml &#8211; java conversion.</li>
<li>Improved Support for Message-style interaction (RPC vs Message-based)</li>
<li>Improved handlers</li>
</ol>
<p>The goal of this article is to focus on parsing technology, so I will not discuss in detail the new features on Axis2. If you want to find out more, read <a href="http://www.jaxmag.com/itr/online_artikel/psecom,cur,,_psframe,,linkobject,print_,nocontainer,1_,id,747,nodeid,147.html">this</a>.</p>
<p>&nbsp;</p>
<h2>Reference</h2>
<p><a href="http://www.xml.com/lpt/a/1287">An Introduction to StAX</a></p>
<p><a href="http://jaxmag.com/itr/online_artikel/psecom,id,726,nodeid,147.html">Fast and lightweight object model for XML</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/design/evolution-of-xml-parsing-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Axis2 vs XFire</title>
		<link>http://www.solutionhacker.com/implement-your-idea/design/axis2-vs-xfire/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/design/axis2-vs-xfire/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 19:36:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[axis]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[StAX]]></category>
		<category><![CDATA[XFire]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/2007/12/06/axis2-vs-xfire/</guid>
		<description><![CDATA[<p>Recently, I have assigned a web service project to one of my developers. To provide a guideline to choose the stack, I need to look into the solution provided by Axis and XFire again. Previously, it is no brainer in favor of <strong>XFire</strong> because Axis 1 is using <strong>DOM</strong> based parser whereas XFire is using <strong>StAX</strong>. Now, Axis 2 has come out that uses StAX parser as well. After a series of benchmark comparison and arguments from both parties. I feel that picking either framework isn't likely to matter much. And if it does matter, make sure you chose the proper <strong>databinding</strong> toolkit as that will have the biggest affect on your performance.</p>
<p>For XFire, it uses <strong>JAXB</strong> for databinding by default that you are replaced with <strong>JiBX</strong>. Why JiBX is faster? The reason is JAXB uses reflection to populate the bean whereas JiBX uses byte code generation. According to Dan, JiBX has significant performance improvements.  <code> JiBX can provide significant performance improvements over JAXB as it does not use reflection, but instead does byte code generation to optimize databinding - <a href="http://netzooid.com/blog/" target="_blank">Dan</a> </code></p>
<p>For Axis2, it creates its own databinding solution named <strong>ADB</strong> and it is comparable with JiBX. So, Axis2 really has caught up its competitors in term of performance. Whether I will switch to use Axis2. Probably not. Because I don't see it worth the hassle to learn another databinding solution and WS framework that gives you practically the same thing that XFire already provided.  By switching to a StAX based framework you're likely to see something like a 3-5x speedup (or something like 30x if you switch from rpc/encoded to doc/literal as well). This can make a significant difference in your application's responsiveness and load handling. As long as you are using StAX, you are good.  Oh, before I forget. For anyone who is using XFire or attempt to use XFire, please look at Apache CXF. According to XFire, CXF is XFire 2.0. I am excited to see those new features from CXF:</p>
<ol>
    <li>Spring 2.0 XML support</li>
    <li>RESTful service support</li>
    <li>JSON support</li>
    <li>And some of WS specs support as well</li>
</ol>
<p>Here is what I found from XFire site:  <em>We encourage all users who are currently evaluating XFire to use CXF instead at this point. If you are already an XFire user, you may wish to consider <span class="nobr"><a href="http://cwiki.apache.org/CXF20DOC/xfire-migration-guide.html"><font color="#2266cc">migrating to CXF depending</font></a></span> on where you are in your own release cycle. We will continue to support XFire in the future with bug fix releases, but feature development will be focused on CXF.</em>  <em>* </em>UPDATE * 12/6/2007: Apache CXF 2.0 currently doesn't support JiBX. It is expecting to support it for CXF 2.1.  <strong>Reference</strong>  <a href="http://www.infoq.com/news/2007/02/axis2-xfire-benchmark">http://www.infoq.com/news/2007/02/axis2-xfire-benchmark</a></p>]]></description>
			<content:encoded><![CDATA[<p>Recently, I have assigned a web service project to one of my developers. To provide a guideline to choose the stack, I need to look into the solution provided by Axis and XFire again. Previously, it is no brainer in favor of <strong>XFire</strong> because Axis 1 is using <strong>DOM</strong> based parser whereas XFire is using <strong>StAX</strong>. Now, Axis 2 has come out that uses StAX parser as well. After a series of benchmark comparison and arguments from both parties. I feel that picking either framework isn&#8217;t likely to matter much. And if it does matter, make sure you chose the proper <strong>databinding</strong> toolkit as that will have the biggest affect on your performance.</p>
<p>For XFire, it uses <strong>JAXB</strong> for databinding by default that you are replaced with <strong>JiBX</strong>. Why JiBX is faster? The reason is JAXB uses reflection to populate the bean whereas JiBX uses byte code generation. According to Dan, JiBX has significant performance improvements.  [code]]czoyMjA6XCIgSmlCWCBjYW4gcHJvdmlkZSBzaWduaWZpY2FudCBwZXJmb3JtYW5jZSBpbXByb3ZlbWVudHMgb3ZlciBKQVhCIGFzIGl7WyYqJl19dCBkb2VzIG5vdCB1c2UgcmVmbGVjdGlvbiwgYnV0IGluc3RlYWQgZG9lcyBieXRlIGNvZGUgZ2VuZXJhdGlvbiB0byBvcHRpbWl6ZXtbJiomXX0gZGF0YWJpbmRpbmcgLSA8YSBocmVmPVwiaHR0cDovL25ldHpvb2lkLmNvbS9ibG9nL1wiIHRhcmdldD1cIl9ibGFua1wiPkRhbjwvYT4gXCJ7WyYqJl19O3tbJiomXX0=[[/code]</p>
<p>For Axis2, it creates its own databinding solution named <strong>ADB</strong> and it is comparable with JiBX. So, Axis2 really has caught up its competitors in term of performance. Whether I will switch to use Axis2. Probably not. Because I don't see it worth the hassle to learn another databinding solution and WS framework that gives you practically the same thing that XFire already provided.  By switching to a StAX based framework you're likely to see something like a 3-5x speedup (or something like 30x if you switch from rpc/encoded to doc/literal as well). This can make a significant difference in your application's responsiveness and load handling. As long as you are using StAX, you are good.  Oh, before I forget. For anyone who is using XFire or attempt to use XFire, please look at Apache CXF. According to XFire, CXF is XFire 2.0. I am excited to see those new features from CXF:</p>
<ol>
<li>Spring 2.0 XML support</li>
<li>RESTful service support</li>
<li>JSON support</li>
<li>And some of WS specs support as well</li>
</ol>
<p>Here is what I found from XFire site:  <em>We encourage all users who are currently evaluating XFire to use CXF instead at this point. If you are already an XFire user, you may wish to consider <span class="nobr"><a href="http://cwiki.apache.org/CXF20DOC/xfire-migration-guide.html"><font color="#2266cc">migrating to CXF depending</font></a></span> on where you are in your own release cycle. We will continue to support XFire in the future with bug fix releases, but feature development will be focused on CXF.</em>  <em>* </em>UPDATE * 12/6/2007: Apache CXF 2.0 currently doesn't support JiBX. It is expecting to support it for CXF 2.1.  <strong>Reference</strong>  <a href="http://www.infoq.com/news/2007/02/axis2-xfire-benchmark">http://www.infoq.com/news/2007/02/axis2-xfire-benchmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/design/axis2-vs-xfire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

