<?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>Chris Giametta &#187; Spring</title>
	<atom:link href="http://www.appfoundation.com/blogs/giametta/tag/spring/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.appfoundation.com/blogs/giametta</link>
	<description>Rich Internet Apps</description>
	<lastBuildDate>Wed, 19 Oct 2011 22:22:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Adobe Flex Social Business Tool – AfConnect AIR Application</title>
		<link>http://www.appfoundation.com/blogs/giametta/2010/07/20/adobe-flex-social-business-tool-%e2%80%93-afconnect-air-application/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2010/07/20/adobe-flex-social-business-tool-%e2%80%93-afconnect-air-application/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 14:09:46 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[FxConnect]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Applications]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Dallas Texas]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/?p=196</guid>
		<description><![CDATA[I wanted to take some time to show one of AppFoundation’s internal applications we use to manage a variety of information such as clients, projects, and communication between the two. AppFoundation&#8217;s social business solution, Af Connect, applies the full potential of Web 2.0 models like communities, collaboration and user generated ...]]></description>
			<content:encoded><![CDATA[<p>I wanted to take some time to show one of AppFoundation’s internal applications we use to manage a variety of information such as clients, projects, and communication between the two. AppFoundation&#8217;s social business solution, Af Connect, applies the full potential of Web 2.0 models like communities, collaboration and user generated content in a secure, managed environment.</p>
<p>The application is built using the Adobe Flex and AIR platform, and utilizes a series of Spring services for persisting its data. The combination of Spring and AIR offers a powerful deployment model with due to the ease of configuration required. The simple, yet robust, deployment is possible because the AIR runtime runs on the client machine.</p>
<p>The AF Connect AIR application enables valid users to view projects they are tied to, messages for those projects, media, and client contact information if that are granted rights to those views. The list below shows what the application feature set is composed of:</p>
<ul>
<li>Social Media connection suite via FxConnect</li>
<li>Account and Project creation</li>
<li>Ability to assign members viewing privledges to selected accounts and projects</li>
<li>Account and Project level messages, connections, and media</li>
<li>Project management of project milestones, details, issues, and tasks</li>
<li>User profile management</li>
<li>Client details, notes, location, contacts, and URL links</li>
</ul>
<div id="attachment_197" class="wp-caption alignleft" style="width: 310px"><a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2010/07/ConnectTasks.png"><img class="size-medium wp-image-197" title="ConnectTasks" src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2010/07/ConnectTasks-300x225.png" alt="Af Connect Task View" width="300" height="225" /></a><p class="wp-caption-text">Af Connect Task View</p></div>
<p> </p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>Solution Overview</strong></p>
<p>With the power of the AIR and Spring platforms, it only took about 4 months to take the application from concept to a working production implementation. A team of designers, Flex developers, and Java developers worked on the application at different points throughout the implementation, working on both the backend data connectors and the user interface.</p>
<p>The client desktop application was built using Adobe Flex and runs in the AIR runtime. Adobe Flex is an application development framework that is used by developers to build applications that run in the Flash Player. Adobe AIR allows developers to create applications for the desktop using Web technologies such as HTML/CSS, Ajax, Flash, and Flex. In addition, AIR provides offline support and a simple deployment paradigm for delivering the client applications.</p>
<p>The mid-tier of this applications is a balance of Spring and Java Servlets to handle the heavy lifting for data processing. This allows for a deployment mechanism where the AIR application runs on the user&#8217;s computer and data is managed by Spring.</p>
<p>The pairing of AIR and Spring makes it possible to retrieve and visualize the data quickly for the users. With Flex and Spring, we can stand up applications at a very fast pace.</p>
<p>One of the features important to the application users was the ability to map the location of our client site. You can see how we integrated with Yahoo Maps in the image below.</p>
<div id="attachment_199" class="wp-caption alignleft" style="width: 310px"><a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2010/07/ConnectLocation.png"><img class="size-medium wp-image-199" title="ConnectLocation" src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2010/07/ConnectLocation-300x225.png" alt="Af Connect Client Location View" width="300" height="225" /></a><p class="wp-caption-text">Af Connect Client Location View</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>This made it easy to add print functions that use the content in the Flex component to send the map to the printer.</p>
<p>To learn how <a href="http://www.appfoundation.com/">AppFoundation </a>can help your organization develop Business Intelligence tools like this one, please visit <a href="http://www.appfoundation.com/">www.appfoundation.com </a>and contact us now.</p>
<p><a href="http://adobe.flex.appfoundation.com">http://adobe.flex.appfoundation.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2010/07/20/adobe-flex-social-business-tool-%e2%80%93-afconnect-air-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile Development with Flex and Java</title>
		<link>http://www.appfoundation.com/blogs/giametta/2009/09/28/agile-development-with-flex-and-java/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2009/09/28/agile-development-with-flex-and-java/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 19:03:55 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Enterprise RIA Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Applications]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Dallas Texas]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/?p=122</guid>
		<description><![CDATA[Over the past several projects I have had the opportunity to develop large scale Flex applications using Agile software development. SCRUM is the major component for this development, it allows my teams of Java and Flex developers to pair together during Sprints.
Each Sprint is 2-3 weeks in length. We plan ...]]></description>
			<content:encoded><![CDATA[<p>Over the past several projects I have had the opportunity to develop large scale Flex applications using Agile software development. SCRUM is the major component for this development, it allows my teams of Java and Flex developers to pair together during Sprints.</p>
<p>Each Sprint is 2-3 weeks in length. We plan out stories that compose what functionality will be delivered in the demo at the end of the Sprint.</p>
<p>Learn more about how <a href="http://www.appfoundation.com">AppFoundation </a>uses Agile Software Development here:</p>
<p><a href="http://www.blog.appfoundation.com/2009/09/22/appfoundation-goes-agile/">AppFoundation goes Agile</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2009/09/28/agile-development-with-flex-and-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dallas Based AppFoundation, Inc &#8211; Enterprise RIA Development</title>
		<link>http://www.appfoundation.com/blogs/giametta/2009/08/21/dallas-based-appfoundation-inc-enterprise-ria-development/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2009/08/21/dallas-based-appfoundation-inc-enterprise-ria-development/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 19:36:46 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Enterprise RIA Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Applications]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Custom Application Development]]></category>
		<category><![CDATA[Enterprise Application Development]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/?p=106</guid>
		<description><![CDATA[I wanted to get the word out that my new company, AppFoundation Technology Group, Inc. has launched its new web site in Adobe Flex.
The site uses Flex to communicate with PHP through HTTPServices to access dynamic content that drives &#8216;pages&#8217; being created in the rich internet application. The graphics were ...]]></description>
			<content:encoded><![CDATA[<p>I wanted to get the word out that my new company, AppFoundation Technology Group, Inc. has launched its new web site in Adobe Flex.</p>
<p>The site uses Flex to communicate with PHP through HTTPServices to access dynamic content that drives &#8216;pages&#8217; being created in the rich internet application. The graphics were mostly done using Photoshop and put into CSS using 9-slice scaling.</p>
<p>You can see the site here: <a href="http://www.appfoundation.com/">www.appfoundation.com</a></p>
<p>Please drop by to see how Af can help you deliver your Enterprise RIA projects and much more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2009/08/21/dallas-based-appfoundation-inc-enterprise-ria-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting at JavaMug Dallas &#8211; Integrating Flex with Spring</title>
		<link>http://www.appfoundation.com/blogs/giametta/2009/06/26/presenting-at-javamug-dallas-integrating-flex-with-spring/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2009/06/26/presenting-at-javamug-dallas-integrating-flex-with-spring/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 14:52:24 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Dallas Texas]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/?p=86</guid>
		<description><![CDATA[I will be the speaker for the July 8th meeting at the Java Metroplex user&#8217;s Group covering Flex and Spring integration.
Please check out www.javamug.org for more information regarding the event. I hope to see you there if you are in the Dallas/Fort Worth area.
I also plan to give a first ...]]></description>
			<content:encoded><![CDATA[<p>I will be the speaker for the July 8th meeting at the Java Metroplex user&#8217;s Group covering Flex and Spring integration.</p>
<p>Please check out <a href="http://www.javamug.org/">www.javamug.org</a> for more information regarding the event. I hope to see you there if you are in the Dallas/Fort Worth area.</p>
<p>I also plan to give a first peek of Af-Connect. Af-Connect is a collaborative application environment that uses a controlled social networking model to share client and project information. You can create private sites to share files, projects, and contacts with partners, co-workers, and clients. The application is built in Adobe AIR on top of a Spring implementation.</p>
<p>Update:<br />
I enjoyed the opportunity to present at JavaMug in Dallas Texas. Thanks to Erik Weibust for being a great host and taking care of the details for me. Here are the presentation slides and Flex, Spring, and FlexLib projects I showed in the meeting.</p>
<p><a href='http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/06/JavaMug_Presentation.pdf'>JavaMug_Presentation</a></p>
<p><a href='http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/06/jm_flexLib.zip'>Flex Library Project</a></p>
<p><a href='http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/06/jm_Spring.zip'>Spring Project</a></p>
<p><a href='http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/06/jm_Flex.zip'>Flex Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2009/06/26/presenting-at-javamug-dallas-integrating-flex-with-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pro Flex on Spring</title>
		<link>http://www.appfoundation.com/blogs/giametta/2009/03/24/pro-flex-on-spring/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2009/03/24/pro-flex-on-spring/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 15:53:38 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/2009/03/24/pro-flex-on-spring/</guid>
		<description><![CDATA[Over the past 5+ years I have done quite a bit of work with Flex and Spring. I am happy to announce the release of my first book; Pro Flex on Spring. You can find the book on www.amazon.com or pick it up at your local Barnes and Nobles.
 
Pro Flex on ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/03/proflexonspringbook.png" title="ProFlexonSpring Book"></a>Over the past 5+ years I have done quite a bit of work with Flex and Spring. I am happy to announce the release of my first book; Pro Flex on Spring. You can find the book on <a href="http://www.amazon.com/">www.amazon.com</a> or pick it up at your local Barnes and Nobles.</p>
<p> <a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/03/proflexonspringbook.png" title="ProFlexonSpring Book"><img src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2009/03/proflexonspringbook.thumbnail.png" alt="ProFlexonSpring Book" /></a></p>
<p>Pro Flex on Spring is the first book covering the use of the Spring Framework as an integration point for the Flex Framework so that enterprise Java developers can now add a Rich Internet Application front end to their “back-end”. Flex on Spring completes the Spring Framework, and makes it arguably the most complete, top-down, application development stack available to Java developers.</p>
<p>What you’ll learn:<br />
• Explore best practices on architecting enterprise Rich Internet Applications<br />
with Flex and Spring.<br />
• Discover how Flex applications interface with Spring services.<br />
• Understand how to persist data, end–to–end, using Flex data communication protocols<br />
with Spring and its interactions with iBATIS, Hibernate, and JDBC.<br />
• Work with solid frameworks, Cairngorm and Pure MVC, to build Flex applications.<br />
• Build a practical application that demonstrates real experience in delivering enterprise RIAs.<br />
• See how Spring Factories play a key role in routing calls to Spring classes from Flex clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2009/03/24/pro-flex-on-spring/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex, Spring, iBATIS, Cairngorm: Bringing It All Together</title>
		<link>http://www.appfoundation.com/blogs/giametta/2007/05/09/flex-spring-ibatis-caringorm-bringing-it-all-together/</link>
		<comments>http://www.appfoundation.com/blogs/giametta/2007/05/09/flex-spring-ibatis-caringorm-bringing-it-all-together/#comments</comments>
		<pubDate>Wed, 09 May 2007 18:00:05 +0000</pubDate>
		<dc:creator>Chris Giametta</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cairngorm]]></category>
		<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.appfoundation.com/blogs/giametta/2007/05/09/flex-spring-ibatis-caringorm-bringing-it-all-together/</guid>
		<description><![CDATA[Over the past years I have been implementing Flex projects in many different settings. They range from business intelligence applications running against large data warehouses to simple tools that perform a very custom business function. From the beginning, using Flex 1.5 to now with Flex 2.0, I have experienced quite a few ...]]></description>
			<content:encoded><![CDATA[<p>Over the past years I have been implementing Flex projects in many different settings. They range from business intelligence applications running against large data warehouses to simple tools that perform a very custom business function. From the beginning, using Flex 1.5 to now with Flex 2.0, I have experienced quite a few challenges and what I consider best practices when developing Flex Rich Internet Applications.  </p>
<p>I believe in creating a consistent, modular, and repeatable architecture. The architecture must be sufficient to support small applications as well as extremely robust enterpirse applications. A key to project success is to create an architecture that new developers can rapidly integrate themselves into and begin to be productive on day one. I feel that Flex combined with Spring, iBATIS, and Cairngorm help me reach these goals of a patterened based, repeatable architecture.</p>
<p>I have put together a sample application that I hope will communicate a series of Flex best practices. This Contact application implements one set of standard CRUD constructs. You should be able to understand how to architect an enterprise application down to a simple tool with this example. One thing I find very helpful about Cairngorm is how it organizes itself in the project space. You can break out modules to separate work for your team. It works in large and small shops.</p>
<p>I would also like to acknowledge the work done by <a href="http://www.cairngormdocs.org/"><font color="#707070">Cairngorm Docs</font></a>, <a href="http://www.coenraets.org/blog/"><font color="#707070">Christophe Coenraets</font></a>, and <a href="http://labs.adobe.com/"><font color="#707070">Adobe Labs</font></a>. I have learned a great deal regarding the technology in this post from those sources as well as many other RIA blogs.</p>
<p> Experience the application:</p>
<p><a target="_blank" href="http://www.appfoundation.com/flexapps/CairngormExampleProject.swf" title="Cairngorm Example Application"><img src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngormexampleapp.png" alt="Cairngorm Example Application" /></a></p>
<h6>Flex Makeup:</h6>
<p>Flex provides a solid framework for building highly interactive Rich Internet Applications. Flex is made up of the following programming aspects:</p>
<ul>
<li><strong>ActionScript 3.0:  </strong>ActionScript 3.0 is a powerful, object-oriented programming language that is ideally suited for rapidly building RIAs. AS3 facilitates rapid development for large applications, handling large data sets, and is object oriented. Java developers will find an easy transition to Flex Actionscript development. AS3 is an ECMAScript compliant language.</li>
<li><strong>MXML</strong>:  MXML is the XML-based language that developers use to lay out components in Flex applications. It provides a declarative approach to controlling an application&#8217;s visual appearance.</li>
<li><strong>Flash 9: </strong>Flex is compiled into Flash .swf. This .swf is executed on the client by the Flash Virtual Machine. This allows applications built in Flex to be executed on virtually any platform that supports Flash 9. That includes PCs, hand-held devices, POS Terminals, PDAs, etc&#8230;</li>
</ul>
<p>For more information regarding Flex you can find it at <a href="http://www.adobe.com/products/flex"><font color="#707070">http://www.adobe.com/products/flex</font></a>. The Flex API documentation can be found <a href="http://livedocs.macromedia.com/flex/2/langref/index.html"><font color="#707070">here</font></a>.</p>
<h6>Spring Makeup:  </h6>
<p>Spring is a popular Java framework that provides a central automated configuration for writing your application objects. Springs lightweight container is capable of assembling loosely-coupled components which is the basis for reuse.</p>
<p>The DAO implementation support allows Spring to easily integrate with persistence frameworks like Toplink, Hibernate, JDO, and iBATIS. One key beneift of using Spring is if you ever need to change your persistence framework you can do so by decoupling your existing framework and plugging in a new persistence framework. You will retain the majority of your code base.</p>
<p>You can find more information about Spring at <a href="http://www.springframework.org/"><font color="#707070">http://www.springframework.org</font></a>.</p>
<h6>iBATIS Makeup:</h6>
<p>iBATIS is a data mapping framework that couples objects with stored procedures or SQL statements using an XML structure. iBATIS allows simple integration to your database of choice.</p>
<p>I like iBATIS for the flexibilty of the SQL entered in the SQLMaps. Many of the Flex applications I have written reside on top of a data warehouse. I need to create complex SQL that runs effeciently on databases like Netezza, Oracle, Teradata, and Informix.</p>
<p>More information about iBATIS can be found at <a href="http://ibatis.apache.org"><font color="#707070">http://ibatis.apache.org</font></a>.</p>
<h6>Cairngorm Makeup:</h6>
<p>Cairngorm is an architectural framework that offers a starting point for RIA development. It directs consistency, realiabiliy, and modularity in Rich Internet Development for the User Interface by implementing reliable design patterns.</p>
<p>Using Cairngorm allows you to break up project work across large teams. Flex aids in this by allowing you to easily produce an application wrapper to build modules in Flex tied together by Cairngorm.</p>
<p>The Cairngorm architecture is built to allow you to handle user gestures on the client, manage client state, and encapsulate business logic in the client.</p>
<p>In this article we will discuss how Cairngorm implenets Command, Delegate, and Service Locator patterns to interact with a Spring/iBATIS service model.</p>
<p>The Cairgorm programming model is made of:</p>
<ul>
<li><strong>Value Object:  </strong>The Cairngorm Value Object acts as a marker interface to help improve readability of code. The VO is nothing more than a mapping to your service bean. This VO is used to help transform incoming object lists to map to flex view objects like a datagrid.</li>
<li><strong>Event: </strong>The event describes the type of object that will be processed when the event is fired. The event sets an event type to be listened to by the controller. The Cairngorm Event class is required for event processing.</li>
<li><strong>Front Controller: </strong>This class controls user actions by binding the event to a specific command. That marrage of these two components allows Flex to detect user gestures and return data to the model.</li>
<li><strong>Command:</strong> The command class enforces the binding of the Event between the Front Controller. The command is responsible for initiating external calls through the Business Delegate.</li>
<li><strong>Business Delegate: </strong>The Business Delegate implements the Responder inteface that handles data returned as the result of a service call. I try to match my Business Delegate to my server side service method implementation. A delegate can call other services as needed, but that can cause code maintainability issues for the application.</li>
<li><strong>Service Locator:</strong> The Business Delegate locates the application level service and passes references of the Commands Result and Fault handlers.</li>
<li><strong>Model Locator:</strong> The Model Lcoator is used to instanciate the applications model and/or models. The locator grants access to data objects that the Command will apply results too for the View layer to assign to components like a datagrid.</li>
</ul>
<p><strong>Flex-Cairngorm Architecture        Spring-iBATIS Architecture</strong></p>
<p><a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngorm2_rpc_ui.png" title="Flex-Cairngorm Architecture"><img src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngorm2_rpc_ui.thumbnail.png" alt="Flex-Cairngorm Architecture" /></a>                       <a href="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngorm2_rpc_ibatisspring.png" title="Spring-iBATIS Architecture"><img src="http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngorm2_rpc_ibatisspring.thumbnail.png" alt="Spring-iBATIS Architecture" /></a></p>
<h5>Application Configuration for Flex, Spring, Cairngorm, and iBATIS</h5>
<h6>Step 1: Get the project files</h6>
<ol>
<li>Download cairngorm-spring-iBATIS.zip <a href="http://www.appfoundation.com/flexapps/downloads/cep.zip"><font color="#707070">here</font></a>. ***This zip file contains all of the files required to run this example project. You do not need to download items 3 through 6 below unless you want to check out the open-source projects themselves.</li>
<li>Expand cairngorm-spring-iBATIS.zip to a Tomcat /webapps location or other j2ee web server.</li>
<li>Download the Spring framework at Spring framework (version 2.0) at <a href="http://www.springframework.org/download"><font color="#707070">http://www.springframework.org/download</font></a></li>
<li>Download Cairngorm 2 for Flex at <a href="http://labs.adobe.com/wiki/index.php/Cairngorm"><font color="#707070">http://labs.adobe.com/wiki/index.php/Cairngorm</font></a></li>
<li>Download iBATIS at <a href="http://ibatis.apache.org"><font color="#707070">http://ibatis.apache.org</font></a></li>
<li>Download MySQL at <a href="http://dev.mysql.com/downloads"><font color="#707070">http://dev.mysql.com/downloads</font></a></li>
</ol>
<h6>Step 2: Setting up Cairngorm</h6>
<p>To deploy with Cairngorm you need to simply unpack the Cairngorm.swc and relocate it to:</p>
<p>{context-root}\WEB-INF\flex\user_classes</p>
<h6>Step 3: Setting up Spring</h6>
<ol>
<li>Copy <strong>spring.jar</strong> to {context-root}\WEB-INF\lib directory of your web application</li>
<li>Modify the web.xml file of your web application. Add the <strong>context-param</strong> and <strong>listener</strong> definitions as follows:  
<pre><code>&lt;context-param&gt;     
     &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
     &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
&lt;/context-param&gt;                        

&lt;!-- Spring Session attribute and binding listener support --&gt;
&lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
&lt;/listener&gt;
</code></pre>
</li>
<li>Copy SpringFactory.class and SpringFactory$SpringFactoryInstance.class from your compiled source location to {context-root}WEB-INFclassescomappfoundationcommonfactories. This code developed by Jeff Vroom</li>
<li>Register the Spring factory in {context-root}\WEB-INF\flex\services-config.xml:
<pre><code>&lt;factories&gt;  
     &lt;factory id="spring" class="com.appfoundation.common.factories.SpringFactory"/&gt;
&lt;/factories&gt;
</code></pre>
</li>
</ol>
<h6>Step 4: Setting up iBATIS</h6>
<ol>
<li>Locate <strong>ibatis-common-2.jar</strong>, <strong>ibatis-dao-2.jar</strong>, and <strong>ibatis-sqlmap2.jar</strong></li>
<li>Copy those jar files to:  {context-root}WEB-INFlib</li>
<li>Modify your sql-map-config.xml in: {context-root}WEB-INF
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;&lt;!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"<a href="http://ibatis.apache.org/dtd/sql-map-config-2.dtd">http://ibatis.apache.org/dtd/sql-map-config-2.dtd</a>"&gt;                          

&lt;sqlMapConfig&gt;
      &lt;sqlMap resource="../sqlmaps/Contact.xml" /&gt;
&lt;/sqlMapConfig&gt;
</code></pre>
</li>
</ol>
<h6>Step 5: Register the Spring Beans</h6>
<ol>
<li>Locate your <strong>applicationContext.xml</strong> in {context-root}\WEB-INF</li>
<li>Modify the applicationContext file to include your Spring beans as follows:
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;&lt;!DOCTYPE beans
        PUBLIC "-//SPRING//DTD BEAN//EN"
        "<a href="http://www.springframework.org/dtd/spring-beans.dtd">http://www.springframework.org/dtd/spring-beans.dtd</a>"&gt;
&lt;beans&gt;
     &lt;!-- START Load application properties --&gt;
     &lt;bean id="propertyConfigurer"
       class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
       &lt;property name="location"&gt;&lt;value&gt;classpath:../application.properties&lt;/value&gt;&lt;/property&gt;
     &lt;/bean&gt;
    &lt;!-- END Load application properties --&gt;                          

 &lt;!--  START DB connection info --&gt;
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
         destroy-method="close"&gt;
       &lt;property
         name="driverClassName"&gt;&lt;value&gt;${jdbc.driverClassName}&lt;/value&gt;&lt;/property&gt;
       &lt;property name="url"&gt;&lt;value&gt;${jdbc.url}&lt;/value&gt;&lt;/property&gt;
       &lt;property name="username"&gt;&lt;value&gt;${jdbc.username}&lt;/value&gt;&lt;/property&gt;
       &lt;property name="password"&gt;&lt;value&gt;${jdbc.password}&lt;/value&gt;&lt;/property&gt;
   &lt;/bean&gt;    &lt;bean id="transactionManager"
       class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
       &lt;property name="dataSource"&gt;&lt;ref local="dataSource"/&gt;&lt;/property&gt;
    &lt;/bean&gt;
 &lt;!--  END DB connection info --&gt;    
 &lt;!--  START iBATIS config --&gt;
  &lt;bean id="sqlMapClientTemplate"
     class="org.springframework.orm.ibatis.SqlMapClientTemplate"&gt;
    &lt;property name="sqlMapClient" ref="sqlMapClient" /&gt;
  &lt;/bean&gt;
   &lt;bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"&gt;
       &lt;property name="dataSource" ref="dataSource" /&gt;
       &lt;!--  this needs to point to where the sql-map-config.xml file is --&gt;
       &lt;property name="configLocation" value="classpath:../sql-map-config.xml" /&gt;
   &lt;/bean&gt;
 &lt;!--  END iBATIS config --&gt;                          

 &lt;!--  START DAO config --&gt;
  &lt;bean id="contactDao" class="com.appfoundation.vms.dao.ibatis.ContactDaoImpl"&gt;
   &lt;property name="sqlMapClientTemplate" ref="sqlMapClientTemplate" /&gt;
  &lt;/bean&gt;
 &lt;!--  END DAO config --&gt;
 &lt;bean id="contactService" class="com.appfoundation.vms.services.ContactServiceImpl"&gt;
     &lt;property name="contactDao"&gt;&lt;ref bean="contactDao"/&gt;&lt;/property&gt;       
 &lt;/bean&gt;
&lt;/beans&gt;
</code></pre>
</li>
</ol>
<h6>Step 6: Configure the Flex Remote Services</h6>
<ol>
<li>Locate and open <strong>remoting-config.xml</strong> in {context-root}\WEB-INF\flex.</li>
<li>Add the following destination:
<pre><code>&lt;destination id="contactService"&gt;     
     &lt;properties&gt;
            &lt;factory&gt;spring&lt;/factory&gt;
            &lt;source&gt;contactService&lt;/source&gt;
      &lt;/properties&gt;
&lt;/destination&gt;
</code></pre>
</li>
</ol>
<h6>Step 7: Set up the MySQL Database Table</h6>
<p>I am using MySQL Server 5.0 to run this example database. You can switch to your preferred database by changing the application.properties that iBATIS reads into its connection object. Those properties are injected into the iBATIS persistence framework by Spring.</p>
<ol>
<li>Locate <strong>MySQL-Setup.txt </strong>in {context-root}\WEB-INF\db</li>
<li>Create a new database catalog named <strong>client</strong> </li>
<li>Run the two SQL statements to set up the contacts table and insert a default record</li>
</ol>
<h6>Step 8: Running the Application</h6>
<ol>
<li>Open a browser, access http://host:port/context-root/CairngormExampleProject.mxml, and run the application. For example, I run the application using http://localhost:8080/cep/CairngormExampleProject.mxml in my browser.</li>
</ol>
<param value="http://appfoundation.com/flexapps/BlogPlugCairngormPost1.swf" name="movie"></param><embed height="120" width="396" src="http://appfoundation.com/flexapps/BlogPlugCairngormPost1.swf"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.appfoundation.com/blogs/giametta/2007/05/09/flex-spring-ibatis-caringorm-bringing-it-all-together/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

