<?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"
>

<channel>
	<title>Smooks Data Integration &#187; Technical Info &amp; Concepts</title>
	<atom:link href="http://blog.smooks.org/category/technical-info-concepts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smooks.org</link>
	<description>The official blog</description>
	<lastBuildDate>Mon, 28 Jun 2010 13:10:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<!-- podcast_generator="Blubrry PowerPress/1.0.7" mode="simple" entry="normal" -->
	<itunes:summary>The official blog</itunes:summary>
	<itunes:author>Smooks Data Integration</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://blog.smooks.org/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:owner>
		<itunes:name>Smooks Data Integration</itunes:name>
		<itunes:email>tom.fennelly@gmail.com</itunes:email>
	</itunes:owner>
	<managingEditor>tom.fennelly@gmail.com (Smooks Data Integration)</managingEditor>
	<itunes:subtitle>The official blog</itunes:subtitle>
	<image>
		<title>Smooks Data Integration &#187; Technical Info &amp; Concepts</title>
		<url>http://blog.smooks.org/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://blog.smooks.org/category/technical-info-concepts/</link>
	</image>
		<item>
		<title>Introduction: Using a factory to instantiate beans with the javabean cartridge</title>
		<link>http://blog.smooks.org/2009/10/12/introduction-using-a-factory-to-instantiate-beans-with-the-javabean-cartridge/</link>
		<comments>http://blog.smooks.org/2009/10/12/introduction-using-a-factory-to-instantiate-beans-with-the-javabean-cartridge/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 08:01:59 +0000</pubDate>
		<dc:creator>Maurice</dc:creator>
				<category><![CDATA[Java Binding]]></category>
		<category><![CDATA[Smooks]]></category>
		<category><![CDATA[Technical Info & Concepts]]></category>

		<guid isPermaLink="false">http://blog.smooks.org/?p=354</guid>
		<description><![CDATA[<p>I would like to introduce the new factory feature in the Javabean cartridge of the up coming Smooks 1.3 release. This new features makes it possible to use a static factory method or a factory object to instantiate objects with the Javabean cartridge.</p>
<p><span id="more-354"></span></p>
<p>Before this new feature you could only instantiate new beans by providing the class name of the bean and the bean would then be created using it&#8217;s public parameterless constructor. So it was mandatory to have a parameterless constructor on the Javabean. Here is an example:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.ArrayList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>But now it is possible to use a factory to instantiate the bean. So you don&#8217;t need a public parameterless constructur anymore. You even don&#8217;t have to define the actual class name any more. Any of the interfaces that the class implements suffices. However only the methods of that interface are available for binding then. Here is an example where we instantiate an ArrayList object using a static factory method:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.List&quot;
   factory=&quot;some.package.ListFactory#newList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>With the factory attribute you set the factory definition. The class attributes defines that a List object is returned. What kind of List object (ArrayList, LinkedList) is up to the ListFactory to decide. Here is another example:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.List&quot;
   factory=&quot;some.package.ListFactory#getInstance.newList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>Here we define that an instance of the ListFactory needs to be retrieved using the static method getInstance() and that then the newList() method needs to be called on the ListFactory object to create the List object. This construct makes it possible to easily call Singleton Factories.</p>
<p>The default factory definition language looks like this: <strong>factory.class#static_method<em>{.instance_method}</em></strong></p>
<p>It is also possible to use MVEL as the factory definition language. MVEL has some advantages over the basic default definition language, for example you can use objects from the bean context as the factory object or  you can call factory methods with parameters. These parameters can be defined within the definition or they can be objects from the bean context. To be able to use MVEL you must set the &#8216;factory.definition.parser.class&#8217; global parameter to &#8216;org.milyn.javabean.factory.MVELFactoryDefinitionParser&#8217;.</p>
<p>Here is an example using MVEL:</p>
<pre class="brush: xml;">
&lt;smooks-resource-list
   xmlns=&quot;http://www.milyn.org/xsd/smooks-1.1.xsd&quot;
   xmlns:jb=&quot;http://www.milyn.org/xsd/smooks/javabean-1.3.xsd&quot;&gt;

	&lt;params&gt;
		&lt;param name=&quot;factory.definition.parser.class&quot;&gt;
			org.milyn.javabean.factory.MVELFactoryDefinitionParser
		&lt;/param&gt;
	&lt;/params&gt;

    &lt;jb:bean
		beanId=&quot;orders&quot;
		class=&quot;java.util.List&quot;
		factory=&quot;some.package.ListFactory.getInstance().newList()&quot;
		createOnElement=&quot;orders&quot;
	&gt;
		&lt;!-- ... bindings --&gt;
    &lt;/jb:bean&gt;

&lt;/smooks-resource-list&gt;
</pre>
<p>Maybe you wonder why we don&#8217;t use MVEL as the default factory definition language? Currently the performance of the basic definition language and MVEL is about equal. The reason that the basic definition language isn&#8217;t faster is because it currently uses reflection to call the factory methods. However there are plans to use byte code generation instead of reflection. This should improve the performance dramatically. If MVEL where the default language then we couldn&#8217;t do anything to improve the performance for those people who don&#8217;t need any thing more then the basic features that the basic definition language offers.</p>
<p>If you have any questions or remarks then I would gladly hear them.</p>
<div style="display:block"><small><em>posted in <a href="http://blog.smooks.org/category/java-binding/">Java Binding</a> by Maurice <a href="http://blog.smooks.org/2009/10/12/introduction-using-a-factory-to-instantiate-beans-with-the-javabean-cartridge/#comments">Leave A Comment</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>I would like to introduce the new factory feature in the Javabean cartridge of the up coming Smooks 1.3 release. This new features makes it possible to use a static factory method or a factory object to instantiate objects with the Javabean cartridge.</p>
<p><span id="more-354"></span></p>
<p>Before this new feature you could only instantiate new beans by providing the class name of the bean and the bean would then be created using it&#8217;s public parameterless constructor. So it was mandatory to have a parameterless constructor on the Javabean. Here is an example:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.ArrayList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>But now it is possible to use a factory to instantiate the bean. So you don&#8217;t need a public parameterless constructur anymore. You even don&#8217;t have to define the actual class name any more. Any of the interfaces that the class implements suffices. However only the methods of that interface are available for binding then. Here is an example where we instantiate an ArrayList object using a static factory method:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.List&quot;
   factory=&quot;some.package.ListFactory#newList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>With the factory attribute you set the factory definition. The class attributes defines that a List object is returned. What kind of List object (ArrayList, LinkedList) is up to the ListFactory to decide. Here is another example:</p>
<pre class="brush: xml;">
&lt;jb:bean
   beanId=&quot;orders&quot;
   class=&quot;java.util.List&quot;
   factory=&quot;some.package.ListFactory#getInstance.newList&quot;
   createOnElement=&quot;orders&quot;
&gt;
     &lt;!-- ... bindings --&gt;
&lt;/jb:bean&gt;
</pre>
<p>Here we define that an instance of the ListFactory needs to be retrieved using the static method getInstance() and that then the newList() method needs to be called on the ListFactory object to create the List object. This construct makes it possible to easily call Singleton Factories.</p>
<p>The default factory definition language looks like this: <strong>factory.class#static_method<em>{.instance_method}</em></strong></p>
<p>It is also possible to use MVEL as the factory definition language. MVEL has some advantages over the basic default definition language, for example you can use objects from the bean context as the factory object or  you can call factory methods with parameters. These parameters can be defined within the definition or they can be objects from the bean context. To be able to use MVEL you must set the &#8216;factory.definition.parser.class&#8217; global parameter to &#8216;org.milyn.javabean.factory.MVELFactoryDefinitionParser&#8217;.</p>
<p>Here is an example using MVEL:</p>
<pre class="brush: xml;">
&lt;smooks-resource-list
   xmlns=&quot;http://www.milyn.org/xsd/smooks-1.1.xsd&quot;
   xmlns:jb=&quot;http://www.milyn.org/xsd/smooks/javabean-1.3.xsd&quot;&gt;

	&lt;params&gt;
		&lt;param name=&quot;factory.definition.parser.class&quot;&gt;
			org.milyn.javabean.factory.MVELFactoryDefinitionParser
		&lt;/param&gt;
	&lt;/params&gt;

    &lt;jb:bean
		beanId=&quot;orders&quot;
		class=&quot;java.util.List&quot;
		factory=&quot;some.package.ListFactory.getInstance().newList()&quot;
		createOnElement=&quot;orders&quot;
	&gt;
		&lt;!-- ... bindings --&gt;
    &lt;/jb:bean&gt;

&lt;/smooks-resource-list&gt;
</pre>
<p>Maybe you wonder why we don&#8217;t use MVEL as the default factory definition language? Currently the performance of the basic definition language and MVEL is about equal. The reason that the basic definition language isn&#8217;t faster is because it currently uses reflection to call the factory methods. However there are plans to use byte code generation instead of reflection. This should improve the performance dramatically. If MVEL where the default language then we couldn&#8217;t do anything to improve the performance for those people who don&#8217;t need any thing more then the basic features that the basic definition language offers.</p>
<p>If you have any questions or remarks then I would gladly hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smooks.org/2009/10/12/introduction-using-a-factory-to-instantiate-beans-with-the-javabean-cartridge/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Multiple Results &amp; Outputs with Smooks</title>
		<link>http://blog.smooks.org/2009/08/29/multiple-results-outputs-with-smooks/</link>
		<comments>http://blog.smooks.org/2009/08/29/multiple-results-outputs-with-smooks/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 12:28:40 +0000</pubDate>
		<dc:creator>Tom Fennelly</dc:creator>
				<category><![CDATA[Technical Info & Concepts]]></category>

		<guid isPermaLink="false">http://blog.smooks.org/?p=337</guid>
		<description><![CDATA[<p>Smooks can produce &#8220;output&#8221; in a number of different ways.  It can produce multiple sets of results, as well as output fragments of data to multiple different endpoints (ESB Service Endpoints, Files, JMS Destinations, DBs etc&#8230; and in different formats), all in a single filtering pass of a message stream.</p>
<p>For more on this, <a href="http://www.smooks.org/mediawiki/index.php?title=Multiple_Outputs/Results">please see the Smooks Wiki&#8230;</a></p>
<div style="display:block"><small><em>posted in <a href="http://blog.smooks.org/category/technical-info-concepts/">Technical Info &amp; Concepts</a> by Tom Fennelly <a href="http://blog.smooks.org/2009/08/29/multiple-results-outputs-with-smooks/#comments">Leave A Comment</a></em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Smooks can produce &#8220;output&#8221; in a number of different ways.  It can produce multiple sets of results, as well as output fragments of data to multiple different endpoints (ESB Service Endpoints, Files, JMS Destinations, DBs etc&#8230; and in different formats), all in a single filtering pass of a message stream.</p>
<p>For more on this, <a href="http://www.smooks.org/mediawiki/index.php?title=Multiple_Outputs/Results">please see the Smooks Wiki&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smooks.org/2009/08/29/multiple-results-outputs-with-smooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
