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

<channel>
	<title>Gridshore &#187; Java</title>
	<atom:link href="http://www.gridshore.nl/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gridshore.nl</link>
	<description>A weblog about software engineering, Architecture, Technology an other things we like.</description>
	<lastBuildDate>Tue, 13 Dec 2011 15:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Axon Framework 0.6 released</title>
		<link>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/</link>
		<comments>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 17:53:45 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Axon Framework]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[Domain Driven Design]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/</guid>
		<description><![CDATA[<p>Today, I released version 0.6 of the Axon Framework. 0.6 has many new features and is another step towards full production readiness. There is still some work to do, but first, let’s take a look at what has changed…</p> <p></p> <p>Test fixtures are now part of the axon-test module. These fixtures allow you to [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 0.6 of the Axon Framework. 0.6 has many new features and is another step towards full production readiness. There is still some work to do, but first, let’s take a look at what has changed…</p>
<p><span id="more-1070"></span></p>
<p>Test fixtures are now part of the axon-test module. These fixtures allow you to test your command handling logic based on events and commands. You define these tests in a given-when-then style: given these past events, when I execute this command, I expect these events to occur.</p>
<p>The <tt>CommandBus</tt> interface now allows for asynchronous command dispatching. Instead of using a return value, a Callback can be given to the command bus if you wish to be notified of the result of command execution.</p>
<p>The repositories make use of a <tt>UnitOfWork</tt> instance, which keeps track of changed aggregates and generated events. Instead of saving each aggregate separately, the <tt>UnitOfWork</tt> can be committed, causing changed aggregates to be stored, and events to be dispatched. With the new <tt>SimpleUnitOfWorkInterceptor</tt> or the <tt>SpringTransactionalInterceptor</tt>, it is no longer necessary to call <tt>repository.save()</tt>. In fact, you are discouraged from doing so.</p>
<p>Repositories are now capable of detecting conflicting modifications. When loading an aggregate, you may pass in the expected version of the aggregate. An exception is raised if that version does not match the actual version.</p>
<p>Event sourcing repositories allow for a more advanced way of detecting conflicts. Sometimes, not all concurrent modification are in conflict with each other. One user may very well change the shipping address of an order, while another user is adding items. Other modifications, however, are clearly conflicting, such as one user marking an order as shipped, and another one adding a product. For this purpose, you can register a <tt>ConflictResolver</tt> with the repository. This conflict resolver can, based on unseen and newly applied events, decide whether the changes made by the second user are accepted.</p>
<p>Axon now provides a mechanism to trigger snapshot creation based on the number of events needed to load to reconstitute an aggregate. When the number of events exceeds a given threshold, a snapshot is created and stored in the Event Store.</p>
<p>The <tt>SimpleCommandBus</tt> and <tt>SimpleEventBus</tt> now expose statistics over JMX. Although currently quite limited, the statistics will be improved in the coming versions.</p>
<p>All of these features help making applications with CQRS-based architectures even easier. But we’re not there yet. The coming months, we will try to make it even easier with features like Event versioning, support for aggregates with multiple entities, and whatever comes to mind in Axon’s growing community.</p>
<p>For more information about the Axon Framework, see <a href="http://www.axonframework.org">www.axonframework.org</a>.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2010%2F08%2F08%2Faxon-framework-0-6-released%2F&amp;title=Axon%20Framework%200.6%20released&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Axon Framework 0.5 released</title>
		<link>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/</link>
		<comments>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 15:27:59 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Axon Framework]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Domain Driven Design]]></category>
		<category><![CDATA[JTeam]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/</guid>
		<description><![CDATA[<p> Today, I finalized the 0.5 release of the Axon Framework. There is quite a number of changes since the 0.4 version. The 0.5 version is a major step towards production readiness of the framework.</p> <p>Besides some changes to existing building blocks, such as the event bus, which is now much more powerful, the [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px; display: inline;" src="http://www.gridshore.nl/wp-content/uploads/axon_logo.png" alt="" align="left" /> Today, I finalized the 0.5 release of the Axon Framework. There is quite a number of changes since the 0.4 version. The 0.5 version is a major step towards production readiness of the framework.</p>
<p>Besides some changes to existing building blocks, such as the event bus, which is now much more powerful, the 0.5 version also includes some new features.</p>
<p>Read on to find out more.</p>
<p><span id="more-1047"></span></p>
<h2><strong>New features</strong></h2>
<ul>
<li><strong>Code restructuring.</strong> The package structure has been changed to better reflect the different architectural components Axon Framework provides. It should be easier to find the one you&#8217;re looking for.</li>
<li><strong>Command Bus.</strong> The command bus is added to Axon. It provides you the ability to explicitly define commands and dispatch them to your command handlers. Furthermore, the command bus provides you the ability to process commands regardless of their type using interceptors. This is useful for, for example, logging, authorization and correlation of incoming commands.</li>
<li><strong>JPA Event Store. </strong>The easiest CQRS configuration is on using full-consistency. That means everything should run within a single transaction. Since transactions over multiple data sources involve a huge performance penalty, Axon provides a JPA Event Store. Its performance is not as good as the FileSystem version, but is does provide transaction support.</li>
<li><strong>Easy switching between full-consistency and eventual consistency.</strong> You can easily choose to process all commands and related events inside a single transaction, or to handle events asynchronously. Choosing for consistency or high-performance is just a matter of configuration. No coding required.</li>
<li><strong>Per-event listener configuration of asynchronous processing.</strong> It is now possible to decide on synchronous vs asynchronous event processing for each event handler individually, just by adding an annotation. If you configure a transaction manager for your event listeners, Axon will process the events in batches and manage the transactions around them.</li>
<li><strong>Support for rolling snapshots.</strong> All event stores will automatically pick up snapshot events. Snapshot events are an important performance booster when aggregates generate a lot of events. Instead of reading all passed events, the event store just needs to read the last snapshot event and the regular events created since the snapshot.</li>
<li><strong>Transactional Event Processing.</strong> Configuring transactions in asynchronous event processing is now a lot easier. 0.5 includes a <tt>SpringTransactionManager</tt> you can use in combination with Spring&#8217;s <tt>PlatformTransactionManager</tt>.</li>
<li><strong>Major documentation update.</strong> The documentation has been restructured to make it easier to find what you&#8217;re looking for.</li>
</ul>
<h2><strong>Maven Central</strong></h2>
<p>Where the 0.4 version required configuration of a repository in your project’s pom.xml, the 0.5 version doesn’t. All required artifacts are available in the maven central repository.</p>
<h2>Workshop and professional support</h2>
<p>We believe that the 0.5 version of Axon Framework is a major step towards production readiness. Therefore, JTeam has decided to provide professional support for the Axon Framework and organize workshops to get you acquainted with the numerous features and choices involved with CQRS.</p>
<p>The first workshop is planned for Friday May 21st in Amsterdam, The Netherlands. For more information, visit <a href="http://www.jteam.nl/training/workshop/cqrs-axon-framework-training-workshop.html">http://www.jteam.nl/training/workshop/cqrs-axon-framework-training-workshop.html</a>.</p>
<h2>Getting started</h2>
<p>Want to get started? Visit <a href="http://www.axonframework.org">www.axonframework.org</a> and download the <a href="http://axonframework.googlecode.com/files/reference-guide-0.5.pdf">reference guide</a>. That should contain enough information to get you started. If you still have questions, drop me a message.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2010%2F04%2F24%2Faxon-framework-0-5-released%2F&amp;title=Axon%20Framework%200.5%20released&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I do with flex as a java programmer</title>
		<link>http://www.gridshore.nl/2008/12/15/things-i-do-with-flex-as-a-java-programmer/</link>
		<comments>http://www.gridshore.nl/2008/12/15/things-i-do-with-flex-as-a-java-programmer/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 21:13:52 +0000</pubDate>
		<dc:creator>jettro</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Frontend Technology]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[flex3]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/?p=528</guid>
		<description><![CDATA[<p>So far I have written a few posts mainly about the implementation of security and flex. In this post I want to focus on a the usage of flex in a more general sense. For the experienced flex programmer, this might not be a very interesting post, still you might find something interesting. For [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gridshore.nl/wp-content/uploads/flexlogo1.png" border="0" alt="flexlogo.png" width="100" height="100" align="left" />So far I have written a few posts mainly about the implementation of security and flex. In this post I want to focus on a the usage of flex in a more general sense. For the experienced flex programmer, this might not be a very interesting post, still you might find something interesting. For all java programmers that want to learn more about flex, this post will be an interesting read. Some of the topics I&#8217;ll discuss are: Using renderers, using stacks, creating effects, event driven frameworks and everything else that I run into.<br />
<span id="more-528"></span></p>
<h2>IDE</h2>
<p>Use a good IDE to create your mxml and ActionScript code. The most obvious choice is <a href="http://www.adobe.com/products/flex/">Flex Builder</a> from adobe. To me there is a very big disadvantage, flex builder is based on the eclipse platform. Since I am an <a href="http://www.jetbrains.com/idea/index.html">IntelliJ</a> user, this is a (Big) problem. Luckily flex development is becoming better in IntelliJ. I tend to use IntelliJ for my coding, but I use Flex builder for running and debugging. Also when developing Air you are completely dependent on flex builder. When I can completely use IntelliJ I&#8217;ll let you know <img src='http://www.gridshore.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<h2>Build tool</h2>
<p>Use a build system that makes you independent from for instance flex builder. There is a pretty good maven plugin for creating flex applications. So what maven plugin am I talking about? <a href="http://blog.flex-mojos.info/">Flex mojo&#8217;s from Velo</a>. It is a very good set of plugins to create your swf files. You can find more information on the <a href="http://code.google.com/p/flex-mojos/">google code project</a>. To be honest, I think there could be more documentation on how to start working with this plugin. There are a few things you can do to make life easier. One of them is use an existing maven archetype from <a href="http://fna.googlecode.com/svn/trunk/fna/site/index.html">FNA</a>. Another one is using my <a href="http://code.google.com/p/gridshore/source/browse/#svn/trunk/books-overview">sample application</a> as a reference.</p>
<h2>ActionScript and Mxml</h2>
<p>Adobe flex comes with two main languages, an xml language called mxml. This can do a lot already, but if you need real power, you need to use the other languages called ActionScript. The mxml language is very powerful for creating a nice user interface. With just a few lines of code you can create a complete page which obtains data from a remote source (yahoo boss for instance) and presents the returned data in a table.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
&lt;mx:VBox&gt;
&lt;mx:Form defaultButton=&quot;{doSearch}&quot;&gt;
&lt;mx:TextInput id=&quot;searchQuery&quot; focusEnabled=&quot;true&quot;/&gt;
&lt;mx:Button id=&quot;doSearch&quot; label=&quot;Search&quot; click=&quot;searchRequest.send()&quot;/&gt;
&lt;/mx:Form&gt;
&lt;mx:DataGrid dataProvider=&quot;{searchRequest.lastResult.ysearchresponse.resultset_web.result}&quot; width=&quot;1000&quot; height=&quot;500&quot;&gt;
&lt;mx:columns&gt;
&lt;mx:DataGridColumn id=&quot;linkTitle&quot; headerText=&quot;title&quot; dataField=&quot;title&quot;/&gt;
&lt;mx:DataGridColumn id=&quot;linkUrl&quot; headerText=&quot;url&quot; dataField=&quot;url&quot;/&gt;
&lt;mx:DataGridColumn id=&quot;linkAbstract&quot; headerText=&quot;abstract&quot; dataField=&quot;abstract&quot; dataTipField=&quot;abstract&quot;/&gt;
&lt;mx:DataGridColumn id=&quot;linkDate&quot; headerText=&quot;date&quot; dataField=&quot;date&quot; /&gt;
&lt;/mx:columns&gt;
&lt;/mx:DataGrid&gt;
&lt;/mx:VBox&gt;

&lt;mx:HTTPService id=&quot;searchRequest&quot;
url=&quot;http://boss.yahooapis.com/ysearch/web/v1/%E2%80%9D{searchQuery.text}%E2%80%9D?appid=xvO3DBXIkY2zZpDxKmItnM1vUC9kyxHb&amp;format=xml&quot;
useProxy=&quot;false&quot;
method=&quot;GET&quot;/&gt;
&lt;/mx:Application&gt;
</pre>
<p>With this great power comes a risk, without some standards and a bit of structure your code can become a mess. There are also limitations on mxml, that is when ActionScript jumps in. If we look at the previous sample, we can add a click listener that opens a returned link by clicking on it in a new window. To do this you add the following code to the DataGrid : itemClick=&#8221;clickLink(event)&#8221;. To make it work we use a script block, check the following code.</p>
<pre class="brush: xml; title: ; notranslate">
private function clickLink(event:ListEvent):void {
var url:String = String(event.currentTarget.selectedItem.url);
newWin(url);
}

private function initFocus():void {
searchQuery.setFocus();
}

private function newWin(url:String):void {
var urlRequest:URLRequest = new URLRequest(url);
navigateToURL(urlRequest, &quot;_blank&quot;);
}
</pre>
<p>Finally we make sure the searchBox gets focus by adding this line to the Application tag: applicationComplete=&#8221;initFocus()&#8221;. The following image shows a screendump of the application.</p>
<p><img src="http://www.gridshore.nl/wp-content/uploads/screendumpflexappyahooboss.png" border="0" alt="ScreendumpFlexAppYahooBoss.png" width="600" align="center" /></p>
<p>One thing that is missing in a default implementation of the DataGrid is filtering. For my first bigger flex project I have created such a control. You can read more about it in my blog item : <a href="http://www.gridshore.nl/2008/03/25/creating-a-flex-3-datagrid-component-with-backend-filtering/">creating a flex 3 datagrid with back-end filtering</a>.</p>
<p>The last thing I would like to mention on this topic is that everything that you can do with mxml can also be done with ActionScript. Sometimes it is more obvious to use one over the other. For me, I use mxml for the real view components, action script is used for everything else. Check out the frameworks topic for ways to help you structure you application.</p>
<h2>Using States</h2>
<p>Did you ever create an application where a click on a button changed the complete screen? Elements get reshuffled, some appear, others disappear. Than using states is going to be your thing. I was creating a screen that contained a list of elements. Clicking on one of the items moved focus to the detail pane. I wanted the overview pane to be disabled but visible when working on one of the items. In the other state where the user is looking for an item from the list, the detail pane must be invisible. I started with a function that changed properties of all items. It turns out that states are the real answer. Check the following example where we have a form that needs to be entered in three steps. During a step the other steps can be visible, but they need to be disabled.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; applicationComplete=&quot;initState()&quot;&gt;
&lt;mx:Script&gt;
... CDATA[ // sorry I have problems posting the real CDATA tag
private function initState():void {
currentState='state1';
}
]]...
&lt;/mx:Script&gt;
&lt;mx:states&gt;
&lt;mx:State name=&quot;state1&quot;&gt;
&lt;mx:SetProperty target=&quot;{tareaStep1}&quot; name=&quot;editable&quot; value=&quot;true&quot;/&gt;
&lt;/mx:State&gt;
&lt;mx:State name=&quot;state2&quot;&gt;
&lt;mx:SetProperty target=&quot;{tareaStep2}&quot; name=&quot;editable&quot; value=&quot;true&quot;/&gt;
&lt;/mx:State&gt;
&lt;mx:State name=&quot;state3&quot;&gt;
&lt;mx:SetProperty target=&quot;{tareaStep3}&quot; name=&quot;editable&quot; value=&quot;true&quot;/&gt;
&lt;/mx:State&gt;
&lt;/mx:states&gt;
&lt;mx:HBox&gt;
&lt;mx:VBox id=&quot;step1&quot;&gt;
&lt;mx:Label text=&quot;Step 1&quot;/&gt;
&lt;mx:Button label=&quot;Done&quot; click=&quot;currentState='state2'&quot;/&gt;
&lt;mx:TextArea id=&quot;tareaStep1&quot; width=&quot;200&quot; height=&quot;400&quot; editable=&quot;false&quot;/&gt;
&lt;/mx:VBox&gt;
&lt;mx:VBox id=&quot;step2&quot;&gt;
&lt;mx:Label text=&quot;Step 2&quot;/&gt;
&lt;mx:Button label=&quot;Done&quot; click=&quot;currentState='state3'&quot;/&gt;
&lt;mx:TextArea id=&quot;tareaStep2&quot; width=&quot;200&quot; height=&quot;400&quot; editable=&quot;false&quot;/&gt;
&lt;/mx:VBox&gt;
&lt;mx:VBox  id=&quot;step3&quot;&gt;
&lt;mx:Label text=&quot;Step 3&quot;/&gt;
&lt;mx:Button label=&quot;Done&quot; click=&quot;currentState='state1'&quot;/&gt;
&lt;mx:TextArea id=&quot;tareaStep3&quot; width=&quot;200&quot; height=&quot;400&quot; editable=&quot;false&quot;/&gt;
&lt;/mx:VBox&gt;
&lt;/mx:HBox&gt;
&lt;/mx:WindowedApplication&gt;
</pre>
<p>In the sample you can edit only one box at a time, by pushing one of the buttons you go to the other box. This might be a bit strange example. You&#8217;d probably use another implementation in the real world. But it shows what you can do. You can also add color or other things like rounded corners. Wonder how? You can use the same means. Provided a default value for a styleName in the TextArea elements and use the SetProperty to change the property <em>styleName</em> into something else. You can do the same thing for the size of the TextArea&#8217;s. The following image gives you an idea what you can easily accomplish.</p>
<div style="text-align:center;"><img src="http://www.gridshore.nl/wp-content/uploads/threestepformstateexample.png" border="0" alt="ThreeStepFormStateExample.png" width="440" height="216" /></div>
<h2>Using renderers</h2>
<p>Using style sheets and inline style information can help you a lot in styling components. Still, sometimes you need more. In a datagrid you want to show an image depending on multiple fields of the current item, or you want to add an image to the items in the dropdown list. There is a good post about <a href="http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html">flex renderers by Peter Ent</a> on flexdev at adobe.com. Some of the most important things to know about flex renderers are that you should use them with care. They can be pretty expensive. They are reused, be sure to take into account that they can have state from the previous use. Let&#8217;s have a look at one of the two samples I mentioned. The select box with an image in each item. An orange point means that you have not read the item yet. The grey one than means of course that you have read it before. The first code shows the ComboBox where the itemRenderer property of the ComboBox is set. The second part is the item renderer itself. The item renderer itself is placed into a separate component to make it more explicit and even re-useable.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:ComboBox id=&quot;selectedPeriod&quot; editable=&quot;false&quot; width=&quot;110&quot; styleName=&quot;salary&quot;
dataProvider=&quot;{WidgetModel.getInstance().availableSalarySlips}&quot;
selectedItem=&quot;{WidgetModel.getInstance().choosenPeriod}&quot;&gt;
&lt;mx:itemRenderer&gt;
&lt;mx:Component&gt;
&lt;myrenderer:PeriodComboBoxItemRenderer/&gt;
&lt;/mx:Component&gt;
&lt;/mx:itemRenderer&gt;
&lt;/mx:ComboBox&gt;
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:HBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; horizontalScrollPolicy=&quot;off&quot;&gt;
&lt;mx:Script&gt;
...CDATA[
import images.EmbeddedImages;

override public function set data( value:Object ) : void {
super.data = value;
if (data.read == true) {
readIcon.source = EmbeddedImages.readSmallImage;
} else {
readIcon.source = EmbeddedImages.unreadSmallImage;
}
}
]] ...
&lt;/mx:Script&gt;
&lt;mx:Label text=&quot;{data.label}&quot; width=&quot;50&quot;/&gt;
&lt;mx:Image id=&quot;readIcon&quot; source=&quot;{EmbeddedImages.unreadSmallImage}&quot;/&gt;
&lt;/mx:HBox&gt;
</pre>
<p>Important about the item renderer is the override of the set data method. Here you have access to the data and can do manipulation when the data is set. In our case we change the actual image that is presented as part of the item. The item itself is generated as an HBox.</p>
<p>As an alternative to an ItemRenderer you can use a labelFunction. You cannot create complete Hbox components, still you can do a lot of formatting. Often that is enough to do. A good example is always to format a date. The following code block gives an example of a DataGrid where one column uses a formatter to format a date.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:Canvas&gt;
&lt;mx:Script&gt;
... CDATA[
private function formatCreatedate(rowItem:Object, column:DataGridColumn):String {
return longDateFormatter.format(rowItem.createdate);
}

]] ...
&lt;/mx:Script&gt;
&lt;mx:DateFormatter id=&quot;longDateFormatter&quot; formatString=&quot;DD/MMM/YY J:NN&quot;/&gt;
&lt;mx:DataGrid&gt;
&lt;mx:DataGridColumn dataField=&quot;createdate&quot; headerText=&quot;Datum&quot; labelFunction=&quot;formatCreatedate&quot;/&gt;
&lt;/mx:DataGrid&gt;
&lt;/mx:Canvas&gt;
</pre>
<h2>Styling and effects</h2>
<p>Styling your application is very easy, oke, the basic styling. You will find out that the styling details can be very hard to accomplish. Still some things like these perfectly rounded corners, are so damn easy. I already used this technique in the sample with the different states. The following piece of code shows the code for the example.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:Style&gt;
.active {
corner-radius:10px;
border-color:yellow;
border-thickness:2px;
}
.inactive {
corner-radius:0px;
background-color:#dddddd;
}
&lt;/mx:Style&gt;
</pre>
<p>I am not going into great details about all the other possible things. What I do want to mention are effects. When you are moving from one state to another, you can use effects to make it look very nice. There are a lot of resources to be found on the web. I have extended my three step form with a nice state transition effect. The following code block shows the transition.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:transitions&gt;
&lt;mx:Transition fromState=&quot;state1&quot; toState=&quot;state2&quot;&gt;
&lt;mx:Parallel&gt;
&lt;mx:Resize widthTo=&quot;200&quot; widthFrom=&quot;100&quot; target=&quot;{tareaStep2}&quot;/&gt;
&lt;mx:Resize widthTo=&quot;100&quot; widthFrom=&quot;200&quot; target=&quot;{tareaStep1}&quot;/&gt;
&lt;/mx:Parallel&gt;
&lt;/mx:Transition&gt;
&lt;mx:Transition fromState=&quot;state2&quot; toState=&quot;state3&quot;&gt;
&lt;mx:Parallel&gt;
&lt;mx:Resize widthTo=&quot;200&quot; widthFrom=&quot;100&quot; target=&quot;{tareaStep3}&quot;/&gt;
&lt;mx:Resize widthTo=&quot;100&quot; widthFrom=&quot;200&quot; target=&quot;{tareaStep2}&quot;/&gt;
&lt;/mx:Parallel&gt;
&lt;/mx:Transition&gt;
&lt;mx:Transition fromState=&quot;state3&quot; toState=&quot;state1&quot;&gt;
&lt;mx:Parallel&gt;
&lt;mx:Resize widthTo=&quot;200&quot; widthFrom=&quot;100&quot; target=&quot;{tareaStep1}&quot;/&gt;
&lt;mx:Resize widthTo=&quot;100&quot; widthFrom=&quot;200&quot; target=&quot;{tareaStep3}&quot;/&gt;
&lt;/mx:Parallel&gt;
&lt;/mx:Transition&gt;
&lt;/mx:transitions&gt;
</pre>
<p>With the use of ActionScript you might be able to make this more generic. But now you can easily follow what happens. Converting it to ActionScript is something I leave up to you guys to resolve. If you really want to see this work, you can <a href="http://www.gridshore.nl/zips/ThreeStepForm.air">download the air version</a>. By the way, you do need the air player to run it <img src='http://www.gridshore.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . If you only want <a href="http://www.gridshore.nl/zips/ThreeStepForm.mxml">the source</a>, you can download it as well</p>
<h2>Frameworks and libraries</h2>
<p>Just like with any technology, flex has a lot of libraries that you can use. There are some very well known libraries and some lesser known. At the moment I use <a href="http://mate.asfusion.com/">Mate</a> for my biggest project. This is a tag-based, event-driven Flex framework. I like the way you can do decoupling and dependency injection. It feels good. I am beginning to learn about Cairgorm. To be honest, for now I like Mate better. But you should not take this as an advise to look only at Mate. Try it out yourself. I am planning on rewriting the books-overview sample with Mate, more on that in posts to come.</p>
<p>Another component I use is the auto complete manager from <a href="http://developer.yahoo.com/flash/astra-flex/">yahoo&#8217;s project astra-flex</a>. Since the project comes with <a href="http://developer.yahoo.com/flash/astra-flex/autocompletemanager/using.html">excellent documentation</a>, I am not going to explain how to use it. So far I have not used other components, feel free to comment on this blog post with good examples.</p>
<h2>Security, BLazeDS and spring integration</h2>
<p>I am keeping this short, read my <a href="http://www.gridshore.nl/tag/flex3/">other posts about flex</a> for more details on these topics.</p>
<h2>Concluding</h2>
<p>This post has become long enough. Time to end with some thoughts and some references. Compared to important java frameworks I am missing documentation and good examples. Adobe has documented the sdk pretty thorough though. As a very positive point, there is a very active and helpful community. The maven plugin from velo and the Mate framework are good examples of how people help you when you are stuck. If you are beginning with flex, or you are looking for very specific knowledge you should definitely <a href="http://www.adobe.com/devnet/flex/videotraining/">check out the adobe videos</a>.</p>
<p>I hope this post was helpful, questions and comments are welcome.</p>
<h2>References</h2>
<ul>
<li><a href="http://www.adobe.com/devnet/flex/articles/flex_security.html">http://www.adobe.com/devnet/flex/articles/flex_security.html</a></li>
<li><a href="http://www.adobe.com/devnet/flex/videotraining/">http://www.adobe.com/devnet/flex/videotraining/</a></li>
<li><a href="http://mate.asfusion.com/">http://mate.asfusion.com/</a></li>
</ul>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2008%2F12%2F15%2Fthings-i-do-with-flex-as-a-java-programmer%2F&amp;title=Things%20I%20do%20with%20flex%20as%20a%20java%20programmer&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2008/12/15/things-i-do-with-flex-as-a-java-programmer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using maven to create an osgi bundle (osgi felix sample step 2)</title>
		<link>http://www.gridshore.nl/2008/02/13/using-maven-to-create-an-osgi-bundle-osgi-felix-sample-step-2/</link>
		<comments>http://www.gridshore.nl/2008/02/13/using-maven-to-create-an-osgi-bundle-osgi-felix-sample-step-2/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 08:58:30 +0000</pubDate>
		<dc:creator>jettro</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[felix]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[OSGi]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2008/02/13/using-maven-to-create-an-osgi-bundle-osgi-felix-sample-step-2/</guid>
		<description><![CDATA[<p>This is the second step in a series of items about exploring the felix osgi container and some sidesteps to make life easier while developing osgi bundles. You can find the first step here: http://www.gridshore.nl/2008/02/10/starting-with-osgi-using-apache-felix-step-1/</p> <p>This is so easy, I do not want to spend to much time here. There is a special maven [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gridshore.nl/wp-content/logo1.png" alt="logo.png" border="0" width="165" height="63" align="left" />This is the second step in a series of items about exploring the felix osgi container and some sidesteps to make life easier while developing osgi bundles. You can find the first step here: http://www.gridshore.nl/2008/02/10/starting-with-osgi-using-apache-felix-step-1/</p>
<p>This is so easy, I do not want to spend to much time here. There is a special maven 2 plugin to create a &#8220;bundle&#8221;, check out the following page that describes the plugin :<a href="http://felix.apache.org/site/maven-bundle-plugin-bnd.html"> maven-bundle-plugin</a>.</p>
<p>Create a new maven project using the most basic archetype.</p>
<p>mvn archetype:create -DgroupId=&lt;your.groupid&gt; -DartifactId=&lt;your.artifactId&gt;</p>
<p>Change the packaging of the pom to be &quot;bundle&quot;. Add a dependency to the core and configure the plug in. The possible parameters are described extensively at the mentioned web page. I&#8217;ll explain the what and why of the code below, not the theory. The following pom file is the pom of the project example-client in the FelixTryout project on my <a href="http://code.google.com/p/gridshore/source/browse">google code</a> page. As you can see there is a dependency on the training-service and on jetty. i am not going to talk about jetty here. More on that in one of the next steps.</p>
<pre>
&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;nl.gridshore.samples.bundles&lt;/groupId&gt;
    &lt;artifactId&gt;example-client&lt;/artifactId&gt;
    &lt;packaging&gt;bundle&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;example-client&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;${pom.groupId}&lt;/groupId&gt;
            &lt;artifactId&gt;training-service&lt;/artifactId&gt;
            &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
            &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
            &lt;version&gt;1.0.0&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
            &lt;artifactId&gt;jetty&lt;/artifactId&gt;
            &lt;version&gt;6.1.7&lt;/version&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;source&gt;1.5&lt;/source&gt;
                    &lt;target&gt;1.5&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                &lt;version&gt;1.2.0&lt;/version&gt;
                &lt;extensions&gt;true&lt;/extensions&gt;
                &lt;configuration&gt;
                    &lt;instructions&gt;
                        &lt;Export-Package&gt;
                            nl.gridshore.samples.bundles.exampleclient.api
                        &lt;/Export-Package&gt;
                        &lt;Private-Package&gt;
                            nl.gridshore.samples.bundles.exampleclient.impl
                        &lt;/Private-Package&gt;
                        &lt;Bundle-SymbolicName&gt;${pom.artifactId}&lt;/Bundle-SymbolicName&gt;
                        &lt;Bundle-Activator&gt;
                            nl.gridshore.samples.bundles.exampleclient.impl.Activator
                        &lt;/Bundle-Activator&gt;
                    &lt;/instructions&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;
</pre>
<p>The export-package contains the packages that are exposed to other bundles. This results in the following manifest file:</p>
<pre>
Manifest-Version: 1.0
Built-By: jettro
Created-By: Apache Maven Bundle Plugin
Bundle-Activator: nl.gridshore.samples.bundles.exampleclient.impl.Acti
 vator
Import-Package: javax.servlet;version="2.5",javax.servlet.http;version
 ="2.5",nl.gridshore.samples.bundles.trainingservice.api,org.mortbay.j
 etty;version="6.1",org.mortbay.jetty.servlet;version="6.1",org.osgi.f
 ramework;version="1.3"
Bnd-LastModified: 1202823580612
Bundle-Version: 1.0.0.SNAPSHOT
Bundle-Name: example-client
Build-Jdk: 1.5.0_13
Private-Package: nl.gridshore.samples.bundles.exampleclient.impl
Bundle-ManifestVersion: 2
Bundle-SymbolicName: example-client
Tool: Bnd-0.0.227
</pre>
<p>Most of the items are pretty obvious if you look at the maven configuration. There is one thing that is more advanced. Have a look at the import-Package, this contains the packages that are imported by the classes. This is done automatically by the bundle plugin. You can prevent imports by configuring the &quot;ImportPackage&quot; and use the negative import.</p>
<p>&lt;Import-Package&gt;!org.foo.impl&lt;/Import-Package&gt;</p>
<p>That is about it, mvn clean install and your plugin is installed into the maven repository. Well, of course you do need to implement some java code. Just like I said before, you can find the implementation on google code. I will also introduce the concepts in the forthcoming steps or posts.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2008%2F02%2F13%2Fusing-maven-to-create-an-osgi-bundle-osgi-felix-sample-step-2%2F&amp;title=Using%20maven%20to%20create%20an%20osgi%20bundle%20%28osgi%20felix%20sample%20step%202%29&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2008/02/13/using-maven-to-create-an-osgi-bundle-osgi-felix-sample-step-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

