<?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>Solution Hacker &#187; AMF</title>
	<atom:link href="http://www.solutionhacker.com/tag/amf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Fri, 10 Sep 2010 04:05:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Load and stress testing my website</title>
		<link>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:18:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2.3. Test Your Site]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[charles http proxy]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[load testing]]></category>
		<category><![CDATA[stress testing]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=209</guid>
		<description><![CDATA[Purpose of Load and Stress testing The key goals of load testing are: Find out whether your website can support the expected # of concurrent users. At what load does the app break? To do that, you normally follow these steps: Identifying the primary user path Identifying the expected # of concurrent users. (Both now [...]]]></description>
			<content:encoded><![CDATA[<h2>Purpose of Load and Stress testing</h2>
<p>The key goals of load testing are:</p>
<ol>
<li>Find out whether your website can support the<strong> expected </strong># of concurrent users.</li>
<li>At what load does the app break?</li>
</ol>
<p>To do that, you normally follow these steps:</p>
<ol>
<li>Identifying the primary user path</li>
<li>Identifying the expected # of concurrent users. (Both now and future)</li>
<li>Set up virtual users to hit the app (<strong>load generation capability </strong>is the key factor to pick the right tool. You don&#8217;t want too much hardware investment to generate the load you want, right? <img onclick="grin(':wink:');" alt=":wink:" src="../../../../../wp-includes/images/smilies/icon_wink.gif" />)</li>
<li>Run the test</li>
<li>Analyze the result (throughput under load, avg response time under load)</li>
</ol>
<p><span id="more-209"></span></p>
<h2><!--more-->Challenges to load test Flex app</h2>
<p>We have a web application that has <strong>Flex </strong>frontend talks to J2EE web application backend via <strong>AMF</strong>. How do we load and stress test this system? We certainly can just perform load test against our backend. However, it may need to expose our service via Servlet and load test it as typical restful web service. If we want to simulate Flex and load test through AMF. We need to find a way to capture the AMF requests from Flex client and replay it in our load testing suite. To do that, we can use <a href="http://www.charlesproxy.com/">Charles http proxy</a> to capture the AMF request and tell <strong>JMeter </strong>to load test our application via replaying this AMF request. This&#160; <a href="http://note19.com/2008/05/06/how-to-use-jmeter-to-load-test-flex-applications/">article</a> can give us the detail. However, Charles is a commerical product. If you want a free solution, you can try <a href="http://90kts.com/blog/2008/performance-testing-flex-remoting-amf-with-jmeter/">this</a>.</p>
<p>I know that JMeter comes with proxy to record the request. You can <a href="http://jakarta.apache.org/jmeter/usermanual/best-practices.html#proxy_server">try it out</a> to see whether you can exam the AMF message. Let me know if it works!</p>
<h2>JMeter</h2>
<p><strong><span class="docEmphasis">Load</span> </strong>is all of the users using your web site at a point in time. Load includes users making requests to your web site as well as those reading pages from previous requests. However, we do need some way of differentiating between all clients and those clients actually making requests to our web site. We use the terms <strong><span class="docEmphasis">concurrent load</span></strong> and <strong><span class="docEmphasis">active load</span></strong> (making request) to make this distinction. We use the <strong>JMeter </strong>to help us to generate the load to our system. In term of load generation, we should make sure that we can simulate the <strong>peak load</strong>. JMeter is a great load testing tool. I have heard that Google is using this to load and stress test its application.</p>
<p><embed type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" style="width: 400px; height: 326px;" src="http://video.google.co.uk/googleplayer.swf?docid=-6891978643577501895&amp;hl=en&amp;fs=true" id="VideoPlayback"></embed></p>
<p><u><strong>To use JMeter, follow the steps below:</strong></u></p>
<ol>
<li><strong>Set up Thread Group</strong> &#8211; use to model concurrent virtual users and decide how you want the load be generated.
<ul>
<li><strong>Number of threads</strong>.</li>
<li><strong>The ramp-up period</strong> (it tells JMeter the amount of time for creating the total number of threads). At the beginning of a load test, if the ramp-up period is zero, JMeter will create all the threads at once and send out requests immediately, thus potentially saturating the server and, more importantly, deceivingly increasing the load. That is, the server could become overloaded, not because the average hit rate is high, but because you send all the threads&#8217; first requests simultaneously, causing an unusual initial peak hit rate. The rule of thumb for determining a reasonable ramp-up period is to keep the                         initial hit rate close to the average hit rate.</li>
<li><strong>The number of times</strong> to execute the test.</li>
<li>If the client machine running JMeter lacks enough computing power to model a heavy load, JMeter&#8217;s <strong>distributive testing feature</strong> allows you to control multiple remote JMeter engines from a single JMeter console.</li>
</ul>
</li>
<li><strong>Introduce user think time</strong></li>
<li><strong>Specify response-time requirements and validate test results.</strong></li>
</ol>
<p>To get familiar with it, here are some articles I found it useful</p>
<ol>
<li><a href="http://www.linux.com/feature/34432">Stress testing with JMeter by Daniel Rubio &#8211; Linux.com</a></li>
<li><a href="http://www.devx.com/webdev/Article/17950/0/page/1">Loading testing with Apache JMeter by Kulvir Singh Bhogal, &#8211; Devx.com</a></li>
<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_distributed_testing_step_by_step.pdf">JMeter distributed testing</a></li>
<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">JMeter recording testing</a></li>
<li><a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter">Load test your drupal app scalability with JMeter</a> &#8211; Part 1, <a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter%3A-part-two">Part 2</a></li>
<li><a href="http://www.scribd.com/doc/7499267/Load-Testing-With-JMeter">Load testing with JMeter &#8211; powerpoint</a> &#8211; very good!</li>
<li><a href="http://www.scribd.com/doc/3805411/Scalability-Factors-of-JMeter-in-Performance-Testing-projects">Scalability Factors of JMeter in Performance Testing</a> &#8211; response size, response time, protocol, hardware configuration, load generating tool architecture and configuration, complexity of client-side processing.</li>
<li><a href="http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-jmeter.html?page=1">JMeter Tips &#8211; Javaworld</a></li>
</ol>
<h2>&#160;Reference</h2>
<ol>
<li>Someone has written a nice <a href="http://flex.sys-con.com/node/614811/mobile">article </a>in sys-con to talk about how to load test Flex application.</li>
<li><a href="http://mdzyuba.blogspot.com/2008/05/using-flexunit-for-stress-testing.html">Use FlexUnit for stress testing</a></li>
<li><a href="http://mdzyuba.blogspot.com/2008/05/testing-remote-data-services-with.html">Test Remote Data Service via FlexUnit</a></li>
<li><a href="http://www.igvita.com/2008/09/30/load-testing-with-log-replay/">Load testing with log replay &#8211; interesting idea</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reporting solution!</title>
		<link>http://www.solutionhacker.com/implement-your-idea/build-your-website/reporting-solution/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/build-your-website/reporting-solution/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 08:24:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2.1. Architect Corner]]></category>
		<category><![CDATA[2.2. Build Your Site]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[iBatis]]></category>
		<category><![CDATA[jasper]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[pdf generation]]></category>
		<category><![CDATA[pentaho]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[streaming]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=205</guid>
		<description><![CDATA[Open source reporting My company needs a reporting engine but it doesn&#8217;t want to go for the expensive commerical ones like MicroStrategy. In fact, I don&#8217;t know why we need to pay so much because there are tools out there for FREE. As usual, I googled the Net and found out two seemingly promising open [...]]]></description>
			<content:encoded><![CDATA[<h2>Open source reporting</h2>
<p>My company needs a reporting engine but it doesn&#8217;t want to go for the expensive commerical ones like <strong>MicroStrategy</strong>. In fact, I don&#8217;t know why we need to pay so much because there are tools out there for FREE. As usual, I googled the Net and found out two seemingly promising open source reporting solution.</p>
<ol>
<li><strong>Pentaho </strong>Reporting</li>
<li><strong>Jasper </strong>Reporting</li>
</ol>
<p>Both of them are bundled with a suite of tools related to <strong>OLAP</strong>, <strong>Data Mining</strong>, <strong>ETL</strong>.. etc. To me, I just want an non-invasive reporting engine that can easily integrate into our architecture. To my dismay, I found out Pentaho doesn&#8217;t go this route. It basically gives you a reporting server configured. You could build your reports and deploy them following the manual. However, I hardly see a reporting solution that could satisfy all the business requirements without customization. All I expected from Pentaho is a jar file with documents that shows me how to use its api to generate reports in different formats and how to integrate with our database. I have attempted to look into the code and extracted the stuff I want from Pentaho. However, I found out the engine is actually not powerful. To strip out the workflow part, it is basically a simple SQL executor that later on will render the result according to the UI info embedded in the report definition. What is wrong with that?</p>
<p><span id="more-205"></span></p>
<ol>
<li>We want to handle <strong>pagination </strong>and <strong>data streaming</strong> as our data volume is huge. In Pentaho, you need to take care these yourself. So, you write your own sql, paginate yourself, stream it yourself if the resultset is huge. Isn&#8217;t it what we are doing without it? Apart from that, each report in Pentaho needs a report definition. It supports dynamic sql via token replacement. It is primitive as I want it to support control flow because I may decide what tables to join based on the input filters.</li>
<li>On the UI side, Pentaho helps you to render your result into graph, table&#8230;etc. Again, I don&#8217;t like this UI solution as well. I found that <strong>JFreeChart </strong>is not as powerful as the Flex solution. I am adopting Flex and it gives me much powerful visualization tool. All I want is to ship my Flex app the data from my query&#8217;s result.</li>
</ol>
<p>How about <strong>Japser</strong>? Pretty much the same but the good thing of Jasper is that it gives you the jar and document of how to use it instead of a reporting server like Pentaho. So, I can use it as report renderer to generate PDF and Excel like other utility libraries I use. So, what is my final solution?</p>
<p>I finally decide to create my own report definition that my Flex UI can take and render out the reporting interface. So, I don&#8217;t need to create form for each report. Apart from that, in my report definition, I have iBatis SQL template embedded. So, I can leverage its dynamic sql feature that supports control flow logic and the auto result class population. Yes, I still need to handle pagination and streaming myself. But, at least, it already saves up my time. The result object populated will return to Flex via AMF. So, I don&#8217;t need to marshal and de-marshal it in xml. It saves the processing time and costs less bandwidth. At the end, my solution combines the best in the market:</p>
<ol>
<li>Powerful reporting widgets provided by Flex</li>
<li>Fast streaming and RPC protocol &#8211; <strong>AMF</strong></li>
<li>Good dynamic sql generation and mapping tool from <strong>iBatis</strong></li>
<li>Good reporting rendering tool from Jasper that helps me to do PDF and Excel generation</li>
</ol>
<p>My solution is more flexible. As I can plugin hibernate map if I don&#8217;t want to write my own sql at all. Apart from that, no UI work is needed to deploy a new report unless my generic reporting interface is not enough.</p>
<p>Later, if I really need the workflow engine provided by Pentaho, I can plug it in. Again, the document provided doesn&#8217;t give us clear instruction or APIs of how to do it.</p>
<h2>Reference</h2>
<p>Below are references I used to build my solution:</p>
<ol>
<li><a href="http://Flexible reporting with JasperReports and iBATIS">Flexible reporting with JasperReport and iBatis</a></li>
<li><a href="http://e-docs.bea.com/kodo/docs41/full/html/ref_guide_dbsetup_lrs.html">How Kodo JPA handles large result set</a> (its <a href="http://edocs.bea.com/kodo/docs41/full/html/ref_guide_optimization.html">optimization</a> guide is good reference even you may not use Kodo)</li>
<li><a href="http://my.advisor.com/articles.nsf/aid/14753">Process Large Result Sets in Java Web Application</a></li>
<li><a href="http://www.ahmadsoft.org/articles/stream/presidents.html">Streaming architecture</a></li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/build-your-website/reporting-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wiring up Flex, Mate, BlazeDS, Spring, Hibernate and MySQL with Maven 2 &#8211; Part 1</title>
		<link>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/</link>
		<comments>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 10:50:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2.1. Develop Your Team]]></category>
		<category><![CDATA[2.2. Build Your Site]]></category>
		<category><![CDATA[5. Fun]]></category>
		<category><![CDATA[6. Uncategorized]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[application stack]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[build process]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jetty plugin]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=199</guid>
		<description><![CDATA[Introduction This article is written on top of the great work that&#160;Sébastien Arbogast has done. He has written 3 articles that showed you how to wire up Flex, BlazeDS, Spring, Hibernate and MySQL with Maven as build process. I have included his articles below as your reference. The Flex, Spring, and BlazeDS full stack – [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This article is written on top of the great work that&#160;<strong>Sébastien Arbogast </strong>has done. He has written 3 articles that showed you how to wire up Flex, BlazeDS, Spring, Hibernate and MySQL with Maven as build process. I have included his articles below as your reference.</p>
<ol>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html">The Flex, Spring, and BlazeDS full stack – Part 1: Creating a Flex module</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html">The Flex, Spring and BlazeDS full stack – Part 2: Writing the to-do list server</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html">The Flex, Spring and BlazeDS full stack – Part 3: Putting the application together</a></li>
</ol>
<p>I have found Sebastien&#8217;s work as a good foundation for my own project. To contribute back to the community, I will write a series of articles to show you how can customize and extend the todolist sample.</p>
<p><u>What is in the Part 1 of the series&#8230;</u></p>
<ol>
<li>Enhancements on the <strong>Maven </strong>build process
<ul>
<li>Leverage <strong>RSL </strong>to factor our the framework swc, so the size of the application swf will be reduced. Apart from that, I also take advantage of <strong>Flash Player Cache</strong> that is available after version 9 update 3 to cache the framework libraries.</li>
<li>Clean up the Flex and <strong>BlazeDS </strong>dependencies in POM as the latest version of the sdk is available and the BlazeDS dependencies are officially available.</li>
<li>Include some common reports for maven site generation</li>
<li>Embed <strong>Jetty</strong> web server in the build process for quick deployment and testing</li>
</ul>
</li>
<li>Document how to get the sample up on <strong>Eclipse </strong>for development<strong><br />
    </strong></li>
<li>Use <strong>Mate </strong>as Flex framework
<ul>
<li>Restructure ToDoList sample to leverage Mate framework</li>
<li>Factor out Mate as RSL and integrate it with Maven build process via Flex-mojo plugin.</li>
</ul>
</li>
</ol>
<p><u>What are in the coming articles&#8230;</u></p>
<ol>
<li>In part 2 of this series, I will show you how to use flex-mojo to build a modular Flex application.</li>
<li>In part 3 of this series, I will show you how to test your flex app via FlexUnit (Unit test) and FlexMonkey (Functional test)</li>
<li>In part 4 or this series, I will work on server side. I am planning to add monitoring, caching and security to the server side.</li>
</ol>
<p><span id="more-199"></span><!--more--></p>
<h2><!--more-->Review &#8220;ToDoList&#8221; sample</h2>
<p>Before I start my journey, let me highlight what Sebastien has done first:</p>
<ol>
<li>Sebastien&#8217;s sample demonstrates how to use Maven as a build process. There are 3 parts or subprojects in his sample. They are:
<ul>
<li><strong>todolist-config</strong> (configuration files shared by other subprojects)</li>
<li><strong>todolist-ria </strong>(Flex frontend)</li>
<li><strong>todolist-web</strong> (Server side that supports the Frontend)</li>
</ul>
</li>
<li>All these subprojects are considered as <strong>modules </strong>of the main project (root POM). Finally, they are combined together into war artifact and ready to deploy to Tomcat or other J2EE webapp server.</li>
<li>Flex frontend and backend communicate through a binary RPC protocol &#8211; <strong>AMF</strong>. AMF is considered to be the simplest and fastest remoting approach available in Flex. Recently, Adobe has released BlazeDS as an open source implementation of AMF spec. In this sample, <strong>BlazeDS </strong>is used. To use BlazeDS, there are few things you need to do:
<ul>
<li>Externalize your POJO service via BlazeDS. This sample shows you how to integrate BlazeDS with Spring</li>
<li>Make BlazeDS endpoints availabe to the Net via Servlet.</li>
<li>Have frontend and backend shared the same BlazeDS configuration files.</li>
</ul>
</li>
<li>In this sample, you can also find out how to use <strong>flex-mojo</strong> maven plugin to compile the Flex frontend code into swf. Apart from <a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">flex-mojo plugin</a>, there are other two good plugins worth to mention:
<ul>
<li><strong>maven-assembly-plugin </strong>- can be used to bundle all the files under a directory into a zip file. It is used by todolist-config to bundle all the configuration files (<strong>service-config.xml </strong>and <strong>remoting-config.xml</strong>) into a zip during the <strong>package </strong>phase.</li>
<li><strong>maven-dependency-plugin</strong><strong> &#8211; </strong>can be used to unpack the zip file and move to the place you want. It is used by todolist-web to unpack the config zip during the <strong>generate-resources</strong> phase.</li>
</ul>
</li>
</ol>
<h2>Enhancements on maven POM</h2>
<p>I have modified the sample&#8217;s maven pom as follows:</p>
<ul>
<li>Link to new repository &#8220;<strong>Sonatype Forge</strong>&#8221; in the root POM. So, I can use the new version of flex-mojo and simplify the todolist-ria adobe framework dependencies. Apart from that, I also take away the private repository from Sebastein because BlazeDS libraries are available in official maven repository (Note: The BlazeDS libraries available in official maven repo are in version 3.0 instead of 3.0.0.544. So, you need to modify the webapp pom correspondingly).</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &lt;repositories&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;repository&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;id&gt;flex-mojos-repository&lt;/id&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url&gt;http://svn.sonatype.org/flexmojos/repository/&lt;/url&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;true&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;false&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/repository&gt;<br />
&#160;&#160;&#160; &lt;/repositories&gt;</p>
<p>&#160;&#160;&#160; &lt;pluginRepositories&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pluginRepository&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;id&gt;flex-mojos-repository&lt;/id&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url&gt;http://svn.sonatype.org/flexmojos/repository/&lt;/url&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;true&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/releases&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;enabled&gt;false&lt;/enabled&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/snapshots&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/pluginRepository&gt;<br />
&#160;&#160;&#160; &lt;/pluginRepositories&gt;</p>
</blockquote>
<ul>
<li>Because I link to Sonatype repository, I can have my todolist-ria depends on one flex-framework pom dependency instead of all the swc dependencies. Note that the pom dependency is a way to factor out all the adobe swc dependencies that makes your pom easier to maintain.</li>
</ul>
<blockquote>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &lt;dependency&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;groupId&gt;com.adobe.flex.framework&lt;/groupId&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;artifactId&gt;flex-framework&lt;/artifactId&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;version&gt;3.1.0.2710&lt;/version&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;type&gt;pom&lt;/type&gt;<br />
&#160;&#160;&#160; &#160;&#160;&#160; &lt;/dependency&gt;</p>
</blockquote>
<ul>
<li>I include mysql driver as dependency in my webapp pom. I think it is cleaner to bundle it in war. I have also added <strong>jetty plugin</strong> in the POM so you have a web server embedded in the build process. With this, you can run this sample application right after you check it out from svn (assume you have maven 2 installed). To start jetty, you can issue the following maven command under your webapp project.</li>
</ul>
<blockquote>
<p>project_root&gt; mvn clean install<br />
project_root/jp-web&gt; mvn jetty:run-war</p>
</blockquote>
<ul>
<li>I have included some reports that will be shown after site generation. You may not be able to do <strong>mvn site-deploy </strong>because it is linked to my web hosting site. However, you can modify it for your own sake.</li>
</ul>
<h2>Get the sample up on Eclipse</h2>
<p>To develop on Eclipse, you can follow the steps below:</p>
<ol>
<li>Create Eclipse project file via running the command below at the project root. This will create 2 eclipse projects. One for todolist-ria and one for the webapp. You noticed that I use the <strong>-Declipse.downloadSource=true</strong> to include the source files of my dependencies in my eclipse project. Therefore, I can get to the source code if needed.</li>
</ol>
<blockquote>
<p>mvn -Declipse.downloadSource=true eclipse:eclipse</p>
</blockquote>
<ol>
<li>Import the projects into Eclipse</li>
<li>Add new variable<strong> M2_REPO</strong> and set it equals to<strong> [home]/.m2/repository</strong></li>
<li>If you have installed <strong>Flex Builder plugin</strong> to your Eclipse, you can Add <strong>Flex Project Nature</strong> to the todolist-ria project.
<ul>
<li>Select Application Server Type: J2EE</li>
<li>Put check on &#8220;Use remote object access service&#8221; with LiveCycle Data Service selected.</li>
<li>Set up the path. I have my tomcat installed under C:\tools with default <strong>8080 </strong>as port. You should make the changes if you installed it differently.</li>
<li><img src="http://www.solutionhacker.com/wp-content/uploads/image/flexEclipse1.JPG" style="width: 531px; height: 284px;" alt="" /></li>
<li>Remove the generated <strong>main.mxml</strong> under the src folder.</li>
<li>Set <strong>index.mxml </strong>under src folder as default Flex application file to run.</li>
<li>Use <strong>Default Flex SDK </strong>in Flex Compiler Configuration instead of Server Flex SDK</li>
<li>Right click and select <strong>Recreate HTML Template</strong> if you see error.</li>
<li>After all these, you have configured your Flex application pointing to the webapp server and sharing the BlazeDS configuration files. You can verify in Flex Compiler Configuration&#8217;s Additional Compiler Parameters. See whether you see this: <strong>-services &#8220;C:\tools\tomcat-6.0.16\webapps\jp\WEB-INF\flex\services-config.xml&#8221; -locale en_US</strong></li>
<li>Move the war to your tomcat&#8217;s webapp folder and start it under remote debugging setting. If you are using window, set<strong> DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n</strong> under your bin/catalina.bat.</li>
<li>Start your webapp via bin/startup.bat</li>
<li>Put breakpoint under <strong>TodoServiceImpl</strong> save method and start remote debugger on localhost:8787</li>
<li>Right click the<strong> index.mxml</strong> and Run As Flex Application.</li>
<li>Add a new entry and save it on the flex app. <img onclick="grin(':razz:');" alt=":razz:" src="../../../../../wp-includes/images/smilies/icon_razz.gif" /> You should see your remote debugger halt at the breakpoint for you to debug.</li>
<li>Now you can change your flex code and test it out without leaving your Eclipse. However, if you modify the service in webapp, you need to run &#8220;<strong>mvn clean install</strong>&#8221; and deploy the war to the tomcat before your flex code can call your server-side code via <strong>AMF</strong>.</li>
</ul>
</li>
</ol>
<h2>Use Mate as Framework</h2>
<p>If you are not familiar with Mate, click the image below that moves you to a nice presentation.</p>
<p>&#160;<a href="http://mate.asfusion.com/assets/content//presentations/360_max_presentation.pdf"><img src="http://www.solutionhacker.com/wp-content/uploads/image/mate1.JPG" style="width: 589px; height: 339px;" alt="" /></a></p>
<p><u>What did I do to restructure the todolist sample to make it Mate app?</u></p>
<ol>
<li>&#160;</li>
</ol>
<h2>Download</h2>
<p>I have made my work available at: <a href="http://www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip">www.solutionhacker.com/wp-content/uploads/todolist-jp-modified.zip</a></p>
<h2>Reference</h2>
<p>Below are the references I used for the article:</p>
<ol>
<li><a href="http://docs.flex-mojos.info/flex-compiler-mojo/compile-swf-mojo.html">Flex mojo compiler user guide</a></li>
<li><a href="http://blog.flex-mojos.info/2008/06/04/scopes/">Flex mojo dependency scope rules</a></li>
<li><a href="http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs">Flex 3 feature introduction: Flex 3 RSL</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/flash_player_cache.html">Improving Flex application performance using Flash Player Cache</a></li>
<li><a href="http://fna.googlecode.com/svn/trunk/fna/site/mvn_archetypes/index.html">FNA archetype projects&#160;</a></li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/uncategorized/wiring-up-flex-mate-blazeds-spring-hibernate-and-mysql-with-maven-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Flex for RIA, no AJAX?</title>
		<link>http://www.solutionhacker.com/data-intelligence/data-visualization/why-flex-for-ria/</link>
		<comments>http://www.solutionhacker.com/data-intelligence/data-visualization/why-flex-for-ria/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 03:12:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4.2. Visualize Your Data]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/2007/08/26/why-flex-for-ria/</guid>
		<description><![CDATA[Here is the list of reasons why I chose Flex for the RIA development. Write Once Deploy Everywhere &#8211; Flex generates SWF that runs on top of Flash Player VM and behaves consistently across different browsers, even mobile phones later. With this, all the browser compatibility issues are basically offloaded by Adobe. Solid programming model [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the list of reasons why I chose Flex for the RIA development.</p>
<ol>
<li><strong>Write Once Deploy Everywhere</strong> &#8211; Flex generates SWF that runs on top of Flash Player VM and behaves consistently across different browsers, even mobile phones later. With this, all the browser compatibility issues are basically offloaded by Adobe.</li>
<li><strong>Solid programming model</strong> with rich widgets and libraries.</li>
<li><strong>AMF makes Flex object to Java POJO communication possible</strong>. No need to use verbose XML &#8211; Check out <strong>BlazeDS</strong>.</li>
<li><strong>Flex IDE</strong> is a plugin in Eclipse that gives stepwise debugging, UI design console, code completion and more. Working with Actionscript is like Java.</li>
<li><strong>Flex SDK is open source and free.</strong></li>
<li><strong>Great support on video streaming</strong></li>
<li><strong>Integrate with HTML, Javascript and CSS</strong>, so it is not invasive adoption.</li>
<li><strong>Support offline application via AIR</strong> &#8211; Adobe has been working on the <a href="http://labs.adobe.com/technologies/air/">Adobe Integrated Runtime (AIR)</a> that allows for using existing web application development skills to build and deploy desktop applications. <strong>AIR </strong>is still in early development, but promises to allow developers to use their newly learned Flex skills to build desktop applications. No need to learn Swing, Applet&#8230;etc.</li>
<li><strong>Provide several RPC methods</strong> like HTTPService, WebService, AMF and JSON. AMF is 10x faster than SOAP. James Ward developed his Census Flex application to provide performance benchmarks for the different RPC methods in the mainstream RIA technologies. (<a href="http://flexapps.cvs.sourceforge.net/flexapps/census/">Download</a>)</li>
<li>You can<strong> keep the state in the Flex app</strong> and have your server completely stateless.</li>
<li>More to come! <img src='http://www.solutionhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/data-intelligence/data-visualization/why-flex-for-ria/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
