<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkcGSH0_cSp7ImA9WhRbFkk.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110</id><updated>2012-02-07T20:40:29.349+02:00</updated><category term="angela caicedo" /><category term="logging" /><category term="bpel" /><category term="amazon ec2" /><category term="Google WebStore" /><category term="html5" /><category term="pojo" /><category term="flex builder plugin" /><category term="Flex 4" /><category term="adobe" /><category term="xCode" /><category term="doris chen" /><category term="open source" /><category term="Apple" /><category term="blazeds" /><category term="xmllistcollection" /><category term="myjavaserver" /><category term="equinox" /><category term="EJB" /><category term="Websphere" /><category term="Flash" /><category term="Visual Studio 2008" /><category term="osgi" /><category term="iphone" /><category term="Java Hosting" /><category term="ejb3" /><category term="spring" /><category term="SharedObjects" /><category term="googleTV" /><category term="javaME" /><category term=".net" /><category term="Rich clients" /><category term="windows mobile" /><category term="iOS" /><category term="actionscript" /><category term="resource bundles" /><category term="IBM" /><category term="jcp" /><category term="jaxws2.0" /><category term="Flash Mobile" /><category term="phoneGap" /><category term="Oracle to acquire Sun" /><category term="jsf" /><category term="Java Store" /><category term="simon ritter" /><category term="java" /><category term="Java EE 5" /><category term="Javascript" /><category term="webservices" /><category term="Nexus One" /><category term="graniteds" /><category term="SenchaTouch" /><category term="azure" /><category term="Flex Custom Tooltip" /><category term="Modernizr" /><category term="cloud" /><category term="swt" /><category term="flex" /><category term="io2011" /><category term="javaFx" /><category term="Observer" /><category term="AspectJ" /><category term="android" /><category term="objectify" /><category term="CoffeeScript" /><category term="ButtonBar" /><category term="iphone OS4" /><category term="Java5" /><category term="eclipsist 2008" /><category term="Eclipse" /><category term="Rational" /><category term="yakovfain" /><category term="ria" /><category term="Façade pattern" /><category term="Windows Cafe??" /><category term="Flex4" /><category term="ColdFusion" /><category term="Burrito" /><category term="froyo" /><category term="google" /><category term="reflection" /><category term="eclipse plugins" /><category term="GWT" /><category term="Dependency Injection" /><category term="DZone" /><category term="locale" /><category term="JavaEE6" /><category term="RefCards" /><category term="installiation" /><category term="Oracle" /><category term="james gosling" /><category term="FlexJava" /><category term="Flash CS5" /><category term="Google Chtome" /><category term="Scala" /><category term="NavBar" /><category term="wicket" /><category term="Yusuf Bayraktar" /><category term="javaone" /><category term="remoting" /><category term="Google I/O" /><category term="Design Patterns" /><category term="Play" /><category term="apache" /><category term="TomEE" /><category term="hibernate" /><category term="javase6" /><category term="Flash Builder" /><category term="Decorator Pattern" /><category term="Aytek Arıkoğlu" /><category term="Eclipsist 2009" /><category term="google io" /><category term="itu" /><category term="windows phone system" /><category term="DB4O" /><category term="Eclipsist" /><category term="TabBar" /><category term="Inversion of Control" /><category term="codeplex" /><category term="menubar" /><category term="blaze" /><category term="NoSQL" /><category term="anti-design patterns" /><category term="Google App Engine" /><category term="dataprovider" /><category term="In Action" /><category term="Sun" /><category term="Google Chrome" /><category term="objectiveC" /><category term="blackberry" /><category term="eclipse galileo" /><category term="Future of Java" /><category term="eclipse democamp" /><category term="Singleton" /><category term="microsoft" /><category term="turkish" /><category term="AdobeMax" /><category term="Dart" /><category term="less" /><category term="WPF" /><category term="Silverlight" /><title>Developer Chronicles</title><subtitle type="html">Java, Flex, Android, iOS or anything else fun to code on...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.devchronicles.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.devchronicles.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>99</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DeveloperChronicles" /><feedburner:info uri="developerchronicles" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Ak4CRX8_eip7ImA9WhRUGU8.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-2410396087049017556</id><published>2012-01-01T15:46:00.002+02:00</published><updated>2012-01-30T15:09:24.142+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T15:09:24.142+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Scala" /><category scheme="http://www.blogger.com/atom/ns#" term="flex" /><category scheme="http://www.blogger.com/atom/ns#" term="Play" /><category scheme="http://www.blogger.com/atom/ns#" term="CoffeeScript" /><category scheme="http://www.blogger.com/atom/ns#" term="NoSQL" /><category scheme="http://www.blogger.com/atom/ns#" term="html5" /><category scheme="http://www.blogger.com/atom/ns#" term="phoneGap" /><category scheme="http://www.blogger.com/atom/ns#" term="SenchaTouch" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="Dart" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><category scheme="http://www.blogger.com/atom/ns#" term="GWT" /><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="Modernizr" /><category scheme="http://www.blogger.com/atom/ns#" term="objectiveC" /><category scheme="http://www.blogger.com/atom/ns#" term="actionscript" /><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="android" /><category scheme="http://www.blogger.com/atom/ns#" term="javaME" /><category scheme="http://www.blogger.com/atom/ns#" term="less" /><title>Moving from 2011 to 2012, seriously!</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Hl8Yk-QsBa2b0OxNjOCHiAjCOVg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hl8Yk-QsBa2b0OxNjOCHiAjCOVg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Hl8Yk-QsBa2b0OxNjOCHiAjCOVg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hl8Yk-QsBa2b0OxNjOCHiAjCOVg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I have done several new year posts (for &lt;a href="http://www.devchronicles.com/2009/01/expectations-and-what-left-behind.html"&gt;2008&lt;/a&gt; and &lt;a href="http://www.devchronicles.com/2009/12/looking-back-to-2009-and-predictions.html"&gt;2009&lt;/a&gt;) in the past. Reading them today once again made me remember the saying "be careful about predicting when future is involved".&lt;br /&gt;
&lt;br /&gt;
Both posts clearly show I was a keen believer of Rich Client Platforms especially Adobe's Flex. The rise of iPhone which is followed by iPad and other mobile devices crippled the plugin based web platforms. Adobe who should already been working on mobile version on Flash, was never accepted on iOS but also failed to deliver a reliable Flash Plugin on other platforms. Finally this year Adobe discontinued mobile Flash in favor of focusing on Air.&lt;br /&gt;
&lt;br /&gt;
The fall of the plugin based platforms let HTML5 get even more attention. Even Microsoft who still does not have a real HTML5 supported browser, killed Silverlight and announced HTML5 would be the main development platform for Windows 8 (aka Metro apps).&lt;br /&gt;
&lt;br /&gt;
Despite all the trends there are still a lot of IE6 and 7 (also 8!) users which would make html5 hardly be used in real world projects. However many new web frameworks make use of available features and try to mimic the not supported ones. Still HTML5 might be too bleeding edge unless your project only aim to run on mobile since most of the mobile browsers do fully support most of the HTML5 features.&lt;br /&gt;
&lt;br /&gt;
Android despite all patent issues, still on the rise. With the latest release of version 4.0, the ice cream sandwich, finally both phones and the tablets started running on the same operating system. However the version fragmentation became more visible. Even most of the phones still on sale are still based on version 2.2 or 2.3. Although many vendors announced upgrade plans, even most popular devices failed to updating 2.3. Besides the OS fragmentation, Android devices still lack nice designs and good build quality. Currently the only up to date device on the market is Galaxy Nexus and there are several nice designs such as Sony Experia Arc and Sensation XE/XL but still lacking updated os version.&lt;br /&gt;
&lt;br /&gt;
Meanwhile Apple is still having their glory days. Although there were no major updates, iPhone 4s became a huge sales success. Everyone is waiting for the iPad3 which is rumored to have retina display. Although Apple is rumored to stop selling Mac Pros, Macbooks are getting popular than ever and if you ever had worked on one you would probably know why (if not, please try one! seriously).&lt;br /&gt;
&lt;br /&gt;
Social media and apps are hot. Facebook and Twitter might have already taken the lead but apps like foursquare showed there might be room for more. So Google did not hesitate to jump in with Google+ which became the fastest growing network ever. &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
So here are some keywords for 2012:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Don't count on plugin based platforms (&lt;span style="color: #990000;"&gt;Flash, Silverlight&lt;/span&gt; and even &lt;span style="color: #990000;"&gt;JavaFX&lt;/span&gt;). At least for the next few years the web will be HTML...&lt;/li&gt;
&lt;li&gt;Learn &lt;span style="color: #38761d;"&gt;Javascript&lt;/span&gt;! Although many frameworks might help you to generate js, still it is best to know the real thing.&lt;/li&gt;
&lt;li&gt;Invest in &lt;span style="color: #38761d;"&gt;mobile&lt;/span&gt;! Forget about &lt;span style="color: #990000;"&gt;JavaME&lt;/span&gt; (seriously), even if you are lazy to learn &lt;span style="color: #38761d;"&gt;Objective-C&lt;/span&gt;, you can easily start coding on &lt;span style="color: #38761d;"&gt;Android&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;If you are an existing Flex/Actionscript developer, try out &lt;span style="color: #38761d;"&gt;Flex for mobile&lt;/span&gt;! It is currently the easiest and most reliable way to build apps on both android and ios from one source.&lt;/li&gt;
&lt;li&gt;If you are not then no need to spend time on Flex. Instead learn coding on native or html5. Take a look at &lt;span style="color: #38761d;"&gt;PhoneGap&lt;/span&gt; and &lt;span style="color: #38761d;"&gt;SenchaTouch&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;NoSQL is hot. Give it a try!&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #38761d;"&gt;JavaEE6&lt;/span&gt; became even more lightweight and exciting with WebProfile which made using &lt;span style="color: #990000;"&gt;Spring&lt;/span&gt; obsolete. You can use either &lt;span style="color: #38761d;"&gt;TomEE&lt;/span&gt; or &lt;span style="color: #38761d;"&gt;Glassfish&lt;/span&gt; which boots up just as fast as plain Tomcat.&lt;/li&gt;
&lt;li&gt;Invest in HTML5! Instead of starting from scratch try&lt;span style="color: #38761d;"&gt; &lt;a href="http://html5boilerplate.com/"&gt;HTML5 Boilerplate&lt;/a&gt;&lt;/span&gt; and &lt;a href="http://twitter.github.com/bootstrap/"&gt;Bootstrap from Twitter&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you are keen on HTML5 on real projects, take a look at &lt;span style="color: #38761d;"&gt;Modernizr&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;Unless you are a CSS master, try out &lt;span style="color: #38761d;"&gt;{less}&lt;/span&gt; which might become a good HTML5 companion.&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #38761d;"&gt;CoffeeScript&lt;/span&gt; is getting popular. Again unless you are a Javascript Ninja, it is worth to try.&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #38761d;"&gt;Scala&lt;/span&gt; seems to be a good choice for next language to learn, well even Joshua Bloch says so...&lt;/li&gt;
&lt;li&gt;If you are brave enough to stay on the bleeding edge &lt;span style="color: #38761d;"&gt;Play!&lt;/span&gt; is a great alternative web framework which also has built in support for scala.&lt;/li&gt;
&lt;li&gt;If you are looking for a solid, proven web framework while still able to use HTML5 features, &lt;span style="color: #38761d;"&gt;GWT&lt;/span&gt; would be a wise choice.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #38761d;"&gt;Dart&lt;/span&gt; is new but it is worth to follow. Even if the Dart VM fails to be widely adopted it still has the option to cross compile to Javascript and the Google guys are experienced in doing that!&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-2410396087049017556?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/i-Dhzw8_Bqc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/2410396087049017556/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=2410396087049017556" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2410396087049017556?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2410396087049017556?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/i-Dhzw8_Bqc/moving-from-2011-to-2012-seriously.html" title="Moving from 2011 to 2012, seriously!" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2012/01/moving-from-2011-to-2012-seriously.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAFQn4-eSp7ImA9WhRWEko.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-3442075754115955697</id><published>2011-12-30T22:58:00.000+02:00</published><updated>2011-12-30T22:58:33.051+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-30T22:58:33.051+02:00</app:edited><title>GWT meets Flex: gwt4flex</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SVIugxCnM3kj9OiOT-GzItJUX2k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SVIugxCnM3kj9OiOT-GzItJUX2k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SVIugxCnM3kj9OiOT-GzItJUX2k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SVIugxCnM3kj9OiOT-GzItJUX2k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;2011 was definitely not the year of Flex. With the rise of the mobile devices including tablets, Adobe decided to step back instead of striking back.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lately most of the web UI work I have been doing has moved to gwt from flex. I still feel flex is a great platform and enjoy coding in actionscript but have really doubts about its future.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
While I go deeper in GWT, I found out a very interesting project by Alain Ekambi. I downloaded and gave a test drive. Honestly what I had in mind was different from Alain's aim. I was expecting to find an easy integration of flex from gwt but what Alain had achieved was much more complex, building a Flex application (compiled swf) from gwt style code which is pure java.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I had been teaching and coding flex since version 2 beta, thus I feel very comfortable with actionscipt, mxml and event oriented programming. However not everyone feel that way and that was what Alain tried to achieve with gwt4flex which lets you to code in in GWT but compiles swf files offering a easier learning curve for Java developers.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I emailed Alain to see if I can achieve what I had in my mind, using flex components partially in GWT applications as if they were GWT components. Surprisingly Alain was kind and fast enough to implement what I wanted and sent me a beta jar in several hours.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
GWT4Flex can be dowloaded on this &lt;a href="http://www.emitrom.com/gwt4flex"&gt;link&lt;/a&gt;. The &lt;a href="http://gwt4flex.appspot.com/"&gt;live demo&lt;/a&gt;&amp;nbsp;shows a nice looking flex application, however, if you click the view source button what you will find out will be GWT style source code which does a client side pdf creation.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol class="dp-j" start="1" style="background-color: white; color: #787878; font-family: monospace; font-size: 11px; margin-bottom: 1px; margin-left: 45px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: nowrap;"&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;public&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;class&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;Gwt4FlexExplorer&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;extends&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;FlexEntryPoint&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="annotation" style="color: #646464; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;@Override&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;public&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;void&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;onLoad()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;final&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;Panel&amp;nbsp;panel&amp;nbsp;=&amp;nbsp;Panel.newInstance(&lt;/span&gt;&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"Gwt4Flex&amp;nbsp;and&amp;nbsp;AlivePDF"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;panel.setPercentSize(&lt;span class="number" style="color: #c00000; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;70&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;panel.setCenter(&lt;span class="number" style="color: #c00000; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;0&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;final&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;RichTextEditor&amp;nbsp;richTextEditor&amp;nbsp;=&amp;nbsp;RichTextEditor.newInstance();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;richTextEditor.setPercenSize(&lt;span class="number" style="color: #c00000; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;100&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;panel.addElement(richTextEditor);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Application.get().addElement(panel);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ControlBar&amp;nbsp;controlBar&amp;nbsp;=&amp;nbsp;ControlBar.newInstance();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Button&amp;nbsp;pdfButton&amp;nbsp;=&amp;nbsp;Button.newInstance(&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"Export&amp;nbsp;text&amp;nbsp;to&amp;nbsp;PDF"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"demo/pdf.png"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdfButton.addEventListener(MouseEvent.CLICK,&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;new&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;FlashEventListener&amp;lt;Event&amp;gt;()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="annotation" style="color: #646464; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;@Override&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;protected&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;void&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;onFlashEvent(Event&amp;nbsp;event)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;if&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;(richTextEditor.getText()&amp;nbsp;==&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;null&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;||&amp;nbsp;richTextEditor.getText().isEmpty())&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Alert.show(&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"Please&amp;nbsp;enter&amp;nbsp;a&amp;nbsp;text&amp;nbsp;in&amp;nbsp;the&amp;nbsp;RichTextEditorControl"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;else&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PDF&amp;nbsp;pdf&amp;nbsp;=&amp;nbsp;PDF.newInstance();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf.addPage();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf.writeFlashHtmlText(richTextEditor.getHtmlText());&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Application.get().saveFile(&amp;nbsp;pdf.save(),&amp;nbsp;&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"Generated.pdf"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdfButton.setHeight(&lt;span class="number" style="color: #c00000; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;40&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;controlBar.addElement(pdfButton);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Spacer&amp;nbsp;spacer&amp;nbsp;=&amp;nbsp;Spacer.newInstance();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spacer.setPercentWidth(&lt;span class="number" style="color: #c00000; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;100&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;controlBar.addElement(spacer);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Button&amp;nbsp;sourceButton&amp;nbsp;=&amp;nbsp;Button.newInstance(&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"View&amp;nbsp;Source"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;,&lt;/span&gt;&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"demo/code.png"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sourceButton.addEventListener(MouseEvent.CLICK,&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;new&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;FlashEventListener&amp;lt;Event&amp;gt;()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="annotation" style="color: #646464; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;@Override&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;protected&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword" style="color: #7f0055; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;void&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;onFlashEvent(Event&amp;nbsp;event)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FLEX.navigateToURL(SourceCodeController.getSourceFor(&lt;span class="string" style="color: #2a00ff; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;"RichTextEditor"&lt;/span&gt;&lt;span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;));&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;controlBar.addElement(sourceButton);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;panel.addElement(controlBar);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt" style="background-color: #f7f6f7; border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="" style="border-left-color: rgb(126, 173, 217); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you check &lt;a href="http://www.emitrom.com/"&gt;Emitrom's&lt;/a&gt; website actually they offer much more such as GWT4Touch which lets you code in GWT style Java and use Sencha Touch in the background!&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Although I do encourage everyone to learn new languages, similar to Google's approach of compiling javascript from well known Java, Emitron's tools offer the most easy path for a Java developer to produce Flex or Sencha apps. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Great work Alain!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-3442075754115955697?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/-e8IUDDAHak" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/3442075754115955697/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=3442075754115955697" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3442075754115955697?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3442075754115955697?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/-e8IUDDAHak/gwt-meets-flex-gwt4flex.html" title="GWT meets Flex: gwt4flex" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/12/gwt-meets-flex-gwt4flex.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIER34zeip7ImA9WhRWEU0.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-675861918533877829</id><published>2011-12-28T23:25:00.000+02:00</published><updated>2011-12-28T23:25:06.082+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-28T23:25:06.082+02:00</app:edited><title>JavaEE Revisits Design Patterns: Asynchronous</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0uK9KTJE6HNCKCksMDPr2snQaQM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0uK9KTJE6HNCKCksMDPr2snQaQM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0uK9KTJE6HNCKCksMDPr2snQaQM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0uK9KTJE6HNCKCksMDPr2snQaQM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Although you may not find Asynchronous method calls listed as a design pattern, I find it worth to mention. So here comes the last post of my JavaEE Revisits Design Patterns series.&lt;br /&gt;
&lt;br /&gt;
Asynchronous method calls is not much more than multithreading. Basically it refers to a a method call which would run in a separate thread, thus the main (caller) thread does not need to wait for the result of the execution of the called method. In the age of web programming, developers mostly delegate the threading issues to the running server and creating new threads can be tricky and sometime dangerous on web servers since they usually like to manage the threads themselves.&lt;br /&gt;
&lt;br /&gt;
However, playing nice with the servers while using threads can be very simple with JavaEE. Annotating a method with @Asynchronous would be enough to tell the JavaEE container to run the called method in a separate thread asynchronously.

To test asynchronous execution lets add a new method marked with the Asynchronous annotation to our previous &lt;a href="http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_28.html"&gt;example&lt;/a&gt;.

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Asynchronous;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Observes;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class EventObserver {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="color: #666666;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #cc0000;"&gt;@Asynchronous&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void doLogging(@Observes String log) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("1.Start logging:"+log);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try{&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.sleep(3000);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }catch (InterruptedException e){}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("1.done logging");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void doLogging2(@Observes String log) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("2.Start logging:"+log);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;try{&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.sleep(3000);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }catch (InterruptedException e){}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("2.done logging");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The EventService class remains same except for few lines for logging.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttribute;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttributeType;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Event;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class EventService {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; @Inject&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; private String message;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; @Inject&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; Event&amp;lt;String&amp;gt; event;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void startService(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("start service call "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; event.fire("this is my "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("done...");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Run the application and click on the button on the index.xhtml which would fire up the startService method. The log file should be something similar to the one below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: Observer was successfully deployed in 553 milliseconds.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: start service call A message!!&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: 2.Start logging:this is my A message!!&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: 2.done logging&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: done...&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: 1.Start logging:this is my A message!!&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;INFO: 1.done logging&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Although the log might differ, you should still clearly see the startService method is called which fired the event followed by the execution of the second logging method. The startService method waited until the execution of the second log method is complete. However, the first logging method started and end its execution independently from either of the other methods execution.&lt;br /&gt;
&lt;br /&gt;
Although this example is based on void methods, its quite simple to use Future&amp;lt;&amp;gt; as a return type and to receive a result asynchronously.&lt;br /&gt;
&lt;br /&gt;
Asynchronous annotation is very easy to use and can be very useful in situations where you do not want to wait for the execution of the called method.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-675861918533877829?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/lGOZqemZvc0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/675861918533877829/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=675861918533877829" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/675861918533877829?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/675861918533877829?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/lGOZqemZvc0/javaee-revisits-design-patterns_28.html" title="JavaEE Revisits Design Patterns: Asynchronous" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/12/javaee-revisits-design-patterns_28.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEBR386cSp7ImA9WhRXGEk.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-3427618539293240986</id><published>2011-12-06T21:58:00.001+02:00</published><updated>2011-12-25T23:30:56.119+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-25T23:30:56.119+02:00</app:edited><title>JavaEE Revisits Design Patterns: Observer Part 2</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/29GiWsyiZ4WgcotT1n6L-Z_Auus/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/29GiWsyiZ4WgcotT1n6L-Z_Auus/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/29GiWsyiZ4WgcotT1n6L-Z_Auus/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/29GiWsyiZ4WgcotT1n6L-Z_Auus/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;As seen in the &lt;a href="http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_28.html"&gt;previous post&lt;/a&gt;, JavaEE6 offers an easy way to implement the Observer Pattern. After publishing the post, I had receive few questions on how to differentiate string types that are fired and observed.&lt;br /&gt;
&lt;br /&gt;
Although in real world scenarios you wouldn't probably firing and observing plain strings but your own objects which would be observed by their type, still it is pretty easy to differentiate same type of objects and setup different observers to listen them.&lt;br /&gt;
&lt;br /&gt;
First lets start with the part to differentiate plain strings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;package&amp;nbsp;&lt;span style="background-color: white; line-height: 18px;"&gt;com.devchronicles.observer&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;import java.lang.annotation.ElementType;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;import java.lang.annotation.Retention;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;import java.lang.annotation.RetentionPolicy;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;import java.lang.annotation.Target;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Qualifier;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: white; line-height: 18px;"&gt;/**&lt;/span&gt;&lt;br style="background-color: white; line-height: 18px;" /&gt;&lt;span class="Apple-style-span" style="background-color: white; line-height: 18px;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br style="background-color: white; line-height: 18px;" /&gt;&lt;span class="Apple-style-span" style="background-color: white; line-height: 18px;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br style="background-color: white; line-height: 18px;" /&gt;&lt;span class="Apple-style-span" style="background-color: white; line-height: 18px;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;@Qualifier&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;@Retention(RetentionPolicy.RUNTIME)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;@Target({ElementType.FIELD,ElementType.PARAMETER})&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;public @interface MyEvent {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; Type value();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; enum Type{&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOGGING, MESSAGE&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The interface above will act as annotation to mark the string to be fired and later to be observed just by annotating the appropriate parts.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.ejb.TransactionAttribute;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.ejb.TransactionAttributeType;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.enterprise.event.Event;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;@TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;public class EventService {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; @Inject&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; private String message;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;span style="color: #333333;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;@Inject&amp;nbsp;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;MyEvent&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;(MyEvent.Type.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;LOGGING&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; Event&amp;lt;String&amp;gt; event;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #cc0000;"&gt;@Inject&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;@&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;MyEvent&lt;/span&gt;&lt;span style="color: #cc0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;(MyEvent.Type.MESSAGE)&lt;/span&gt;&lt;/span&gt;&lt;br style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;" /&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; Event&amp;lt;String&amp;gt; anotherEvent;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br style="background-color: white; line-height: 18px;" /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; public void startService(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("start service call "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;span style="color: #333333;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;event.fire("this is my "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #666666;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("done...");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;anotherEvent&lt;/span&gt;&lt;span style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;span style="color: #cc0000;"&gt;.fire("done with the service!");&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br style="background-color: white; line-height: 18px;" /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We just add MyEvent annotation with the desired type and later fire the events as we did before. The parts marked with red is all we added to the example in the previous post.&lt;br /&gt;
&lt;br /&gt;
Now lets annotate the observer part. Again We will be just adding the red parts to the previous example.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;import javax.enterprise.event.Observes;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;public class EventObserver {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; public void doLogging(&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;@Observes&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;MyEvent&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;(MyEvent.Type.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;LOGGING&lt;/span&gt;&lt;span style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;String message){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Observed:"+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #cc0000;"&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;public void doLogging(&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;@Observes&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;MyEvent&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;(MyEvent.Type.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;MESSAGE&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="line-height: 18px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;String message){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #cc0000;"&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Observed another type of message:"+message);&lt;/span&gt;&lt;br style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;" /&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #666666; font-family: 'Courier New', Courier, monospace; line-height: 18px;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That would be all you would need to differentiate even the same type of objects to observe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-3427618539293240986?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/5dCYnSxsT_g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/3427618539293240986/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=3427618539293240986" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3427618539293240986?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3427618539293240986?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/5dCYnSxsT_g/javaee-revisits-design-patterns.html" title="JavaEE Revisits Design Patterns: Observer Part 2" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/12/javaee-revisits-design-patterns.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EARHg8cCp7ImA9WhRRFUw.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5508081423483356449</id><published>2011-11-28T23:35:00.001+02:00</published><updated>2011-11-29T00:34:05.678+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-29T00:34:05.678+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Design Patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="Observer" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaEE6" /><title>JavaEE Revisits Design Patterns: Observer</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dg9EHFDAiyPm21OM8WThyQYiaSM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dg9EHFDAiyPm21OM8WThyQYiaSM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dg9EHFDAiyPm21OM8WThyQYiaSM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dg9EHFDAiyPm21OM8WThyQYiaSM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Aside from being implemented in many languages and many applications, Observer Pattern has been a part of Java since version 1.0. Observer Pattern is also a good implementation of &lt;a href="http://en.wikipedia.org/wiki/Hollywood_Principle"&gt;Hollywood Principle&lt;/a&gt;. Just like Agents in Hollywood like to callback the candidates for a role instead of being called daily to be asked about available jobs, most of the server side resources like the push the available&amp;nbsp;data&amp;nbsp;to the appropriate client instead of being asked for updates on a time interval.&lt;br /&gt;
&lt;br /&gt;
Such time interval queries can be both consuming to much resource on the server and also cause more network traffic than actually needed. Although Java had support for Observer Pattern since day 0, it is always argued to be not the best implementation (Have a look at &lt;a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Observer.html"&gt;Observer&lt;/a&gt; and &lt;a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Observable.html"&gt;Observable&lt;/a&gt;). Being on JavaEE world may even complicate things. However JavaEE6 comes with an alternative.&lt;br /&gt;
&lt;br /&gt;
JavaEE6 offers '@Observable' annotation as an easy out of box implementation of Observer Pattern. Lets &lt;a href="http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns-factory.html"&gt;visit the previous post&lt;/a&gt; and extend it to use observers. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttribute;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttributeType;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Event;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class EventService {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; @Inject&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; private String message;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;@Inject&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; Event&amp;lt;String&amp;gt; event;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void startService(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("start service call "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;event.fire("this is my "+message);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #666666;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("done...");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The EventService class will be injected an Event object of type String which can be used to fire String objects. If you had not read the previous post, &amp;nbsp;message object is a String which will be produced by a factory and injected to the EventService class. To make it simpler you can just type any string constant to the variable called message.&lt;br /&gt;
&lt;br /&gt;
Since we are already done with the observable part, now it is time to create an observer to listen our events.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Observes;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class EventObserver {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void doLogging(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;@Observes&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt; String message){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Observed:"+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The Observes annotation marks the method as an observer for fired String events.&amp;nbsp;If you run the server and fire up start service method, you will realize how magically a string will be injected to EventService class and than fired where it will be caughed (observed) by EventObserver class. Surprisingly that is all you need to implement the observer pattern in JavaEE6.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5508081423483356449?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/s4uTMMx7M-o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5508081423483356449/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5508081423483356449" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5508081423483356449?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5508081423483356449?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/s4uTMMx7M-o/javaee-revisits-design-patterns_28.html" title="JavaEE Revisits Design Patterns: Observer" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_28.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQCRXY4eCp7ImA9WhRRFE4.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-6851327818835735593</id><published>2011-11-28T00:29:00.001+02:00</published><updated>2011-11-28T00:36:04.830+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-28T00:36:04.830+02:00</app:edited><title>JavaEE Revisits Design Patterns: Factory Pattern</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JZ-Htvv-f2yhKO3eLOlzMyFo4rg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JZ-Htvv-f2yhKO3eLOlzMyFo4rg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JZ-Htvv-f2yhKO3eLOlzMyFo4rg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JZ-Htvv-f2yhKO3eLOlzMyFo4rg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
Factory pattern is a popular pattern among most of the programming languages. The idea behind factories are encapsulating the object creation which may subject to change.&lt;br /&gt;
Factory Pattern might be considered as one of the easy to understand and implement design pattern which also can be quite useful. However, the implementation even gets easier JavaEE6. &lt;br /&gt;
&lt;br /&gt;
In JavaEE world '@Produces' annotation is used to create object factories and '@Inject' (aka dependency injection) is used for injecting the needed resource to where approciate. Here is a simple example based on the &lt;a href="http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_11.html"&gt;last post&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.producer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.inject.Produces;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;public class EventProducer {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #990000; font-family: 'Courier New', Courier, monospace;"&gt;@Produces&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public String getMessage(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return "A message!!";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The method annotated with '@Produces' produces string objects. Although the type produced is given as string, you may choose any Java type or your own objects and let the producer method to act as a factory for you.&lt;br /&gt;
&lt;br /&gt;
To use the produced objects we need to inject the same type.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.observer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttribute;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttributeType;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Event;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;@TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;public class EventService {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #990000; font-family: 'Courier New', Courier, monospace;"&gt;@Inject&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; private String message;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void startService(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("start service call "+message);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
When you run and invoke the startService method you will see the string value in the producer method to be injected and printed on the console. Although it might seem a bit magical, JavaEE Producer annotation relies on types which is String in our case, to create objects and inject them when they are asked for,&lt;br /&gt;
&lt;br /&gt;
Producer annotation offers a simple and easy to implement and use. It simply constructs the object type given which works quite well and simple.&lt;br /&gt;
To construct and Inject your own types you may create new Classes or Annotate the injection so a String class might be produced by different factories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-6851327818835735593?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/WI_hnfRFJwg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/6851327818835735593/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=6851327818835735593" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6851327818835735593?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6851327818835735593?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/WI_hnfRFJwg/javaee-revisits-design-patterns-factory.html" title="JavaEE Revisits Design Patterns: Factory Pattern" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns-factory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIBSXozcSp7ImA9WhRSEk4.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-6688088650771512555</id><published>2011-11-13T16:46:00.000+02:00</published><updated>2011-11-14T02:29:18.489+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-14T02:29:18.489+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dependency Injection" /><category scheme="http://www.blogger.com/atom/ns#" term="Design Patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="Inversion of Control" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaEE6" /><title>JavaEE revisits the Design Patterns: Dependency Injection</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xXc1L70NHwgNEMfrxZUT4bpwYsQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xXc1L70NHwgNEMfrxZUT4bpwYsQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xXc1L70NHwgNEMfrxZUT4bpwYsQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xXc1L70NHwgNEMfrxZUT4bpwYsQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;On dark days of J2EE, one of the highlights of Spring Framework was Dependency Injection (or Inversion of Control). Instead of highly complicated and error prone xml configurations and JNDI lookups, Spring offered an easier way of injecting resources (still with the help of xml until Spring 2.0).&lt;br /&gt;
&lt;br /&gt;
JavaEE5 already introduced injection of EJBs via @EJB annotation but JavaEE6 takes this one step forward introducing CDI (Contexts and Dependency Injection). Actually CDI offers a wide range of possibilities (some you may see in following posts) including cdi extensions.&lt;br /&gt;
&lt;br /&gt;
Lets start with seeing some DI in action. Although I have been familiar with JSF from first beta version, I have never been a quite fan of it and prefered either flex or gwt as the front end. However with JSF 2.0, everything is much simpler and tightly integrated with the backend. Just like the &lt;a href="http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns.html"&gt;previous pos&lt;/a&gt;t, start with an empty JavaEE6 Web profile project in the IDE of your choice. With JSF 2.0 the web pages can be named with extension 'xhtml'. Start with creating a simple index.xhtml file in your web source folder with the following content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;?xml version='1.0' encoding='UTF-8' ?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:h="http://java.sun.com/jsf/html"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;h:head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Trying Dependency Injection&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/h:head&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;h:body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Expecting myModel to be injected!&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h:form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h:commandButton value="Ok" action="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;#{myModel.doEvent()}&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/h:form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/h:body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Although our backing bean is not there yet, this xhtml file is expecting a bean named myModel (which would be a class name of MyModel) and a method doEvent. Now we can continue with creating the backing bean. Navigate to the source folder of the project and create a class named MyModel.class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.injection;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.inject.Model;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;@Model&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;MyModel&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public Object &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;doEvent&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This class will be the model for the xhtml page. Since the page has already defined the doEvent method of the injected bean for the action of the command button, every click will fire the doEvent method. Let's continue with adding some functionality to the doEvent method by calling startService from another service bean which would be injected to the model bean.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;@Model&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;public class&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;MyModel&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;@Inject&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #990000; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; EventService service;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public Object&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Courier New', Courier, monospace;"&gt;doEvent&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;(){&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #990000; font-family: 'Courier New', Courier, monospace;"&gt;service.startService();&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
You may have noticed there is no new keyword and a constructor call for the EventService class which will be created and injected seamlessly by the time the model bean wants to use it.&lt;br /&gt;
&lt;br /&gt;
Now it is time to add the stateless session EJB which our model bean will be using.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.injection;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Stateless;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttribute;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.TransactionAttributeType;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.enterprise.event.Event;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.inject.Inject;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;@TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;public class &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;EventService&lt;/span&gt; {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;startService&lt;/span&gt;(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Doing something very important!!");&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may deploy the war file on a test server and navigate to index.xhtml. By the time the page is displayed MyModel class is created and injected into the page which would call its doEvent method when the button is clicked. Also the EventService bean has been created and injected to the MyModel class, thus allowing the model to call startService method.&lt;br /&gt;
&lt;br /&gt;
As you may noticed there is no single new keyword or any constructor call but the two classes has been created and injected by the time they were needed which would let you deal with the real programing work while the cdi is handling the creation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-6688088650771512555?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/NYwbzps7vJc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/6688088650771512555/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=6688088650771512555" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6688088650771512555?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6688088650771512555?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/NYwbzps7vJc/javaee-revisits-design-patterns_11.html" title="JavaEE revisits the Design Patterns: Dependency Injection" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_11.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYNRnszfyp7ImA9WhRSEUo.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-1221392882196103467</id><published>2011-11-12T11:30:00.000+02:00</published><updated>2011-11-13T10:16:37.587+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-13T10:16:37.587+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Design Patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaEE6" /><category scheme="http://www.blogger.com/atom/ns#" term="Singleton" /><title>JavaEE revisits the Design Patterns: Singleton</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7RPSQ57VbVTneXtdA9-k4TAn4dY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7RPSQ57VbVTneXtdA9-k4TAn4dY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7RPSQ57VbVTneXtdA9-k4TAn4dY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7RPSQ57VbVTneXtdA9-k4TAn4dY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;If you haven't read &lt;a href="http://www.amazon.com/gp/product/0201633612/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=flexjaorg-20&amp;amp;linkCode=as2&amp;amp;camp=217145&amp;amp;creative=399369&amp;amp;creativeASIN=0201633612"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=flexjaorg-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0201633612&amp;amp;camp=217145&amp;amp;creative=399369" style="border: none !important; margin: 0px !important;" width="1" /&gt;
 by the famous Gang of Four or &lt;a href="http://www.amazon.com/gp/product/0596007124/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=flexjaorg-20&amp;amp;linkCode=as2&amp;amp;camp=217145&amp;amp;creative=399369&amp;amp;creativeASIN=0596007124"&gt;Head First Design Patterns&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=flexjaorg-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0596007124&amp;amp;camp=217145&amp;amp;creative=399369" style="border: none !important; margin: 0px !important;" width="1" /&gt;
, I strongly suggest you to start with either of them since I will rather show how to implementing the patterns than to describe what they are. However, if you are already familiar with the concept, JavaEE might offer you &lt;a href="http://youtu.be/TSZqL45U2lI"&gt;a pathway to many abilities some considered to be unnatural&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
To start coding you would need:&lt;br /&gt;
&amp;nbsp;- JavaEE6 SDK&lt;br /&gt;
&amp;nbsp;- a JavaEE server&lt;br /&gt;
&amp;nbsp;- an IDE (Eclipse/Netbeans/IntelliJ)&lt;br /&gt;
&lt;br /&gt;
JavaEE SDK for your operating system can be downloaded from Oracle's &lt;a href="http://www.oracle.com/technetwork/java/javaee/downloads/index.html"&gt;website&lt;/a&gt;. Some of the SDK bundles also include Glassfish. If you prefer to use another JavaEE server you may go for JBoss or &lt;a href="http://openejb.apache.org/downloads.html"&gt;TomEE&lt;/a&gt; which is the regular Tomcat bundled with OpenJPA and OpenEJB. Also you may choose to download &lt;a href="http://netbeans.org/downloads/index.html"&gt;Netbeans&lt;/a&gt; which comes bundled with the SDK and the Glassfish in just one package (great for beginners, no configuration needed).&lt;br /&gt;
&lt;br /&gt;
Singleton Pattern can be useful although it is out fashion. &lt;a href="http://www.devchronicles.com/2008/05/design-patterns-revisited-1-singletons.html"&gt;The idea&lt;/a&gt; is basically having only one instance of a class which might be expensive to create. The usual way is just making the constructor private and either creating the object or returning the already cached instance by controlling if it has been created before. There are some pitfalls which the pattern may fail on race conditions or via reflection if the implementation is not right.&lt;br /&gt;
&lt;br /&gt;
JavaEE offers a simple elegant way to create and use Singletons just by adding a simple annotation. Create a new project to start, basically a JavaEE Web Profile Project would be enough to run the examples.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.singleton;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.annotation.PostConstruct;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Singleton;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;@Singleton&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt;public class &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;SomeExpensiveBean&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; @PostConstruct&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void start(){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Started!");&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks to annotations, JavaEE6 do not need any configuration xml. You may see there is a beans.xml in the project which is actually empty and you do not need to add any configuration here. @Singleton annotation marks the class as an Singleton EJB and the container takes care of handling the only instance. To make sure the instance is created at startup, the @Startup annotation is used.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #cc0000; font-family: 'Courier New', Courier, monospace;"&gt;@Startup&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Singleton&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class SomeExpensiveBean {&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
However the Singleton bean might rely on some other bean which we may need to make sure it was created before "SomeExpensiveBean". Surprisingly annotations would still be enough to configure.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Startup&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;@D&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;ependsOn("SomeConfigurationBean")&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Singleton&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;public class SomeExpensiveBean {&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
... and a new bean which the container would make sure it is created first.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;package com.devchronicles.singleton;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.annotation.PostConstruct;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Singleton;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;import javax.ejb.Startup;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;/**&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;* @author Murat Yener&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Startup&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;@Singleton&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt;public class&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;SomeConfigurationBean&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; @PostConstruct&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; public void start(){&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Well, I started first!!!");&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Thats it! The beans will be created as single instances and any time you inject the bean you will get the same instance.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-1221392882196103467?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/xJJARBlixAc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/1221392882196103467/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=1221392882196103467" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/1221392882196103467?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/1221392882196103467?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/xJJARBlixAc/javaee-revisits-design-patterns.html" title="JavaEE revisits the Design Patterns: Singleton" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYCSXoyeip7ImA9WhRSEEw.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-6522015995932964512</id><published>2011-11-11T10:51:00.001+02:00</published><updated>2011-11-11T14:22:48.492+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-11T14:22:48.492+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ejb3" /><category scheme="http://www.blogger.com/atom/ns#" term="TomEE" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaEE6" /><title>JavaEE6 and the Ewoks</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l1buh0j5YiYu7ZHpK0n1ycTQO1E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l1buh0j5YiYu7ZHpK0n1ycTQO1E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l1buh0j5YiYu7ZHpK0n1ycTQO1E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l1buh0j5YiYu7ZHpK0n1ycTQO1E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;JavaEE 6 is a great step forward in Web/Enterprise development. The Web Profile, introduced in JavaEE 6 offers an even lighterweight version of JavaEE6. However there are two problems ahead. First the famous adoption problem as still many coorporations are stuck with version 1.4 and next the resistance to not to use JavaEE.&lt;br /&gt;
&lt;br /&gt;
Star Wars fans usually have mixed feelings on teddy bear like creatures called Ewoks. Those who had watched the tv show 'How I met your Mother', may remember the &lt;a href="http://www.cbs.com/shows/how_i_met_your_mother/video/2150592552/how-i-met-your-mother-field-trip"&gt;episode&lt;/a&gt; on Barney's Ewok theory. According to Barney the appreciation for the Ewoks can be explained with the Ewok Line which basically suggests that anyone born May 25, 1973 and was old enough to think Ewoks are childish by the time they appeared on the Return of the Jedi, simply hates them. However those who were born after, thus being young enough to find them cute, loved them as Ewoks remind them teddy bears.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-_TW_xEM3Q18/Tr0NLRtkSzI/AAAAAAAABo4/GQ0UAh9sJUo/s1600/_1318338052.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193" src="http://2.bp.blogspot.com/-_TW_xEM3Q18/Tr0NLRtkSzI/AAAAAAAABo4/GQ0UAh9sJUo/s320/_1318338052.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a similar pattern in the JavaEE world. Those who are old (and unlucky) enough to use J2EE 1.4 (EJB 1.0/2.0/2.1) in large projects which were heavyweight, had a killing development environment (RAM eating buggy IDEs, servers booting over minutes), over engineered architectures and probably failed resulting a migration to Spring, tend to hate and stay away from JavaEE with a passion, no matter what version is subject to use. So actually the release of JavaEE5 did not really impressed everyone.&lt;br /&gt;
&lt;br /&gt;
However JavaEE has changed. With the advantage of being open and having a large community, forced JavaEE to reshape itself by taking good parts from frameworks such Spring, Hibernate and others. First change was the architecture and coding style. EJBs became lightweight POJOs, unusable entity beans had been replaced with JPA, REST and Web Services became standard and an integral part of the runtime and finally annotations took over XML. Still some might argue JavaEE5 was not yet ready since it was not as mature as Spring and the development environment was still not quick and responsive which I might agree. Using Spring on Tomcat instead of EJBs and JavaEE5 on an application server would greatly increase the development productivity but still JavaEE5 was big step forward designing, leveraging and architecting the Enterprise Java platform from strach.&lt;br /&gt;
&lt;br /&gt;
JavaEE6 aimed the weakest points left. Maturing the platform while offering a fast, lightweight runtime and development platform. Those who suggest using Tomcat because it starts up few seconds where a JavaEE Application Server would take minutes lost their ground with the new JavaEE servers such as Glassfish or Jboss which would start just a little slower than Tomcat. Still if you are a fan of Tomcat, it already has an JavaEE certified version called TomEE which uses OpenEJB / OpenJPA and boots in just a few seconds more than a regular Tomcat.&lt;br /&gt;
&lt;br /&gt;
JavaEE6 not only offers the standards, ease of use, a proven design but also what has been left till now, the developer productivity with the Web Profile which support all you need other than the MDBs. You do not need full blown heavy servers or frankestein IDEs and do not need coffee breaks on builds and server restarts. Downloading the JavaEE6 sdk which is bundled with Glassfish and your favorite IDE is all you need. You can also use Jboss or TomEE as your server.&lt;br /&gt;
&lt;br /&gt;
JavaEE6 is definitely worth to try. It might have taken some time but with following the path which frameworks and the community has pointed, JavaEE became rock solid, cool and productive environment. Some may argue about the vendor support but as the community shifts to JavaEE6, all vendors would only left with one choice to follow and it is for sure whatever happens Java will be the future of development on the enterprise world.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe width="560" height="315" src="http://www.youtube.com/embed/1A-MioPtE70" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-6522015995932964512?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/QdyGVhv1FlE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/6522015995932964512/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=6522015995932964512" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6522015995932964512?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6522015995932964512?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/QdyGVhv1FlE/javaee6-and-ewoks.html" title="JavaEE6 and the Ewoks" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-_TW_xEM3Q18/Tr0NLRtkSzI/AAAAAAAABo4/GQ0UAh9sJUo/s72-c/_1318338052.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/javaee6-and-ewoks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYHQ3g-fSp7ImA9WhRTGEo.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-4506579903458211649</id><published>2011-11-09T23:28:00.001+02:00</published><updated>2011-11-09T23:28:52.655+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-09T23:28:52.655+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="android" /><title>Adobe kills Flash on Mobile</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Jnd4lKOuFB5JfZTgQrvedNfu6JU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jnd4lKOuFB5JfZTgQrvedNfu6JU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Jnd4lKOuFB5JfZTgQrvedNfu6JU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jnd4lKOuFB5JfZTgQrvedNfu6JU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Adobe &lt;a href="http://blogs.adobe.com/conversations/category/developers"&gt;officially announced&lt;/a&gt; that they are not going to support Flash on any mobile platform anymore which ironically I read from my mobile phone. Some might agree Adobe has already moved from Flash to AIR on mobile and this news is &lt;a href="http://yakovfain.com/2011/11/09/the-rumors-of-flash-players-death-are-greatly-exaggerated/"&gt;exaggerated&lt;/a&gt;. However, I just disagree with a passion and here is why.&lt;br /&gt;
&lt;br /&gt;
I like Sony and usually not afraid to buy their new products because they have (mostly) a good history on supporting their products. Anybody remember minidiscs? It was one of the most innovative product Sony has ever released. It was a bold step to revolutionize CD, it was a great step forward on mobility while preserving quality and finally it was the father of MP3. Sony, without telling anyone, did used a compression on the recordings. Although people reacted in a negative way once it was discovered, the idea brought the mp3 in everyones life. However the product had failed in the market. Sony did not step back and tried to strike back in every possible way. They even brought MiniDisc back to life as a mp3 player. Over a decade they kept MiniDisc in the market. They might have failed to get a market share but they did show their support and faith to their own product. Later they did a similar strategy to support with the first PlayStation which did not take that much attention in the beginning.&lt;br /&gt;
&lt;br /&gt;
The moment I read Adobe's retrieval I remember a GTUG meeting which I had a session on Android. Just before me someone had a session on Flex/Air on Android which was still beta that time. As I started my presentation I did take a break on my subject and ask if anyone really believed Adobe could catch up with Apple and Google on supporting the new APIs. Not many people did. Adobe has failed providing the Flash Lite. By the time they were still developing an average mobile device had 1gz cpu and hundreds of mbs of ram which was even ok to full blown JRE. So they moved the other way, porting the full Flash to mobile. By the time the beta has landed on Android (remember the show on AdobeMax?), suddenly we realize that Steve Jobs was right. Flash on mobile device was power consuming, laggy and not good to be operated by touch. Still there was hope so developers waited with faith.&lt;br /&gt;
&lt;br /&gt;
Today Adobe announced the death of Flash on mobile, so can we count on they will hugely invest on AIR on mobile? They did kill flash on mobile, flex builder on linux, flash on linux which were all promises they made. Now can anyone really trust on AIR? Adobe not just abondoned Flash they are loosing developers faith really fast.&lt;br /&gt;
&lt;br /&gt;
Besides Flash is still the most widely available platform on desktop and with the rise of the Android they became available on half of the smart phones which they let it go. I have never seen such a retrieval move from any vendor while having such a market share. It is sad Adobe... it is a sad day for Flash...&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-4506579903458211649?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/88EfuIHBE9s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/4506579903458211649/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=4506579903458211649" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/4506579903458211649?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/4506579903458211649?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/88EfuIHBE9s/adobe-kills-flash-on-mobile.html" title="Adobe kills Flash on Mobile" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/11/adobe-kills-flash-on-mobile.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IGQ38yfyp7ImA9WhdaGEw.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5477909863143847166</id><published>2011-10-28T18:32:00.000+02:00</published><updated>2011-10-28T18:32:02.197+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-28T18:32:02.197+02:00</app:edited><title>Installing Ubuntu on Samsung Series 5 Chromebook</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/izu89W6-j9j0r2UvNtNxWgsI-OY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/izu89W6-j9j0r2UvNtNxWgsI-OY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/izu89W6-j9j0r2UvNtNxWgsI-OY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/izu89W6-j9j0r2UvNtNxWgsI-OY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Chromebook is a nice concept coupled with a sleek, fast, compact but yet capable OS, the ChromeOS. Both Samsung and Acer had released Chromebook models which are relatively cheap but still has good design, quite portable with great battery life. Google also gave away Samsung Series 5 Chromebooks to all attendees of Google I/O 2011 which I also qualified to receive one.&lt;br /&gt;
&lt;br /&gt;
For those who had tried ChromeOS before would already know that it is just a browser built on top of a slimmed linux. It does not let you install apps other than chrome apps and not even has a desktop. However you can still save files and access the file system through the browser. Although in the era of the tablets it might seem a little weird, very soon I realized Chromebook is not a device to replace your laptop or your tablet. It is much lighter and portable than a laptop with great battery life but does not allow you wide variety of apps. Meanwhile it is heavier and chunkier than a tablet and lacks of a touch display but it does have a real browser, an accesible file system and a real keyboard.&lt;br /&gt;
&lt;br /&gt;
So Chromebook is unique concept which can be placed between your laptop and your tablet.&lt;br /&gt;
&lt;br /&gt;
However using ChromeOS for a while, I started feeling the need of using an IDE and since I would be having a trip to Antwerp for Devoxx, I thought it is time to install Ubuntu on my Series 5.&lt;br /&gt;
&lt;br /&gt;
If you google to find out how to install ubuntu on chromebook you will end up with great articles describing how to do it for CR-48. Although most of the procedures will be the same, there are still some differences which may cause some troubles. Instead of using a CR48 tutorial and google for the problems follow this post and the links for a smoother experience.&lt;br /&gt;
&lt;br /&gt;
I will mainly follow this&amp;nbsp;&lt;a href="http://chromeos-cr48.blogspot.com/2011/04/ubuntu-1104-for-cr-48-is-ready.html"&gt;tutorial&lt;/a&gt;&amp;nbsp;which is a great but for CR48.&lt;br /&gt;
&lt;br /&gt;
1. First you need to get root! Unless most CR48 tutorials will guide you to remove battery actually it is much simpler on Samsung Series 5 Chromebooks. On the right side of the device while the display is facing you, you will find a cover just next to the usb port. You will find a tiny switch just next to the sim slot. Find a needle and gently push the switch towards the sim slot. Be careful since the switch is very gentle and tiny, you may easily break it which I did :).&amp;nbsp;&lt;br /&gt;
2. Reboot the device. Press Ctrl+D but do not login. Press CTRL+ALT+F2 (the right arrow on top where F2 should be).&lt;br /&gt;
3. Login as user chronos, without any password.&lt;br /&gt;
4. Run "sudo bash" and "chromeos-firmwareupdate --mode=todev"&lt;br /&gt;
5. Run "wget http://goo.gl/hnkxo; sudo sh hnkxo". This script will ask you how you want to shrink the partition of ChromeOS for installing Ubuntu. The default and recommended option is 9gbs. I am not sure if CR48 has same ssd size with the series 5 but I still used the default value. You may choose any size in increments of 1 at your own risk.&amp;nbsp;After you choose the size the script will repartion the drive. It might take up to 15 minutes so do not turn off your device even there is no activity.&lt;br /&gt;
6. &amp;nbsp;Go through the setup process until you get to the login page. Be sure you are connected to wifi and follow the steps 2 and 3 again. Once again run&amp;nbsp;"wget http://goo.gl/hnkxo; sudo sh hnkxo". This time the script will start downloading Ubuntu 11.04 image which was prepared by &lt;a href="http://chromeos-cr48.blogspot.com/2011/04/ubuntu-1104-for-cr-48-is-ready.html"&gt;Jay Lee&lt;/a&gt;.&lt;br /&gt;
7. The script will download 52 files at total of 1.1gb. If you lose connectivity or run out of battery, just re run the script and it will find out where its left.&lt;br /&gt;
8. The script will make few more updates and your device will restart.&lt;br /&gt;
9. If you do not see Ubuntu running follow steps 2,3,4 again.&lt;br /&gt;
10. Login to ubuntu using user "user" and password "user".&lt;br /&gt;
11. Open a terminal window and run&amp;nbsp;"sudo resize2fs -p /dev/sda7"&amp;nbsp;to finalize resizing your partitions.&lt;br /&gt;
12. Although you are in Ubuntu, it is not the default OS for the boot. To enable an easy switch between Ubuntu and Chrome OS, we will follow this &lt;a href="http://cr-48.wikispaces.com/Dual+Boot+Shortcuts"&gt;steps&lt;/a&gt;.&lt;br /&gt;
13. In ubuntu, navigate to home folder and press ctrl+h.&lt;br /&gt;
14. Double click .bashrc and add "&lt;span class="Apple-style-span" style="background-color: white; font-family: Times, 'Times New Roman', serif; font-size: 17px;"&gt;alias chromeos='sudo cgpt add -i 6 -P 0 -S 0 /dev/sda;sudo reboot'&amp;nbsp;&lt;/span&gt;" to the bottom of the file.&lt;br /&gt;
15. Save the file. Open a terminal and type "chromeos".&lt;br /&gt;
16. When device boots into ChromeOS, press CTRL+ALT+F2 and login as chronos.&lt;br /&gt;
17. Run "sudo vim .profile" and press letter 'i'.&lt;br /&gt;
18. Type "alias ubuntu='sudo cgpt add -i 6 -P 5 -S 1 /dev/sda;sudo reboot' ". Then press esc and press shift+z twice. You should be in the console and saved the file.&lt;br /&gt;
19. Type "exit" and type "chronos" to login again.&lt;br /&gt;
20. Type "ubuntu" to boot in ubuntu again!&lt;br /&gt;
&lt;br /&gt;
If you have any problems you can contact me and check the original links:&lt;br /&gt;
&lt;a href="http://chromeos-cr48.blogspot.com/2011/04/ubuntu-1104-for-cr-48-is-ready.html"&gt;http://chromeos-cr48.blogspot.com/2011/04/ubuntu-1104-for-cr-48-is-ready.html&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://cr-48.wikispaces.com/Dual+Boot+Shortcuts"&gt;http://cr-48.wikispaces.com/Dual+Boot+Shortcuts&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5477909863143847166?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/izwRMT5Nf3Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5477909863143847166/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5477909863143847166" title="16 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5477909863143847166?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5477909863143847166?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/izwRMT5Nf3Y/installing-ubuntu-on-samsung-series-5.html" title="Installing Ubuntu on Samsung Series 5 Chromebook" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>16</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/10/installing-ubuntu-on-samsung-series-5.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYMSHo5eCp7ImA9WhdaFEg.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-3512359039163425901</id><published>2011-10-24T11:34:00.000+02:00</published><updated>2011-10-24T13:03:09.420+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-24T13:03:09.420+02:00</app:edited><title>Android vs JDK7; First Act..</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/s0y-YhXwwE_c73aP-C5_2mMOJ3k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s0y-YhXwwE_c73aP-C5_2mMOJ3k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/s0y-YhXwwE_c73aP-C5_2mMOJ3k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s0y-YhXwwE_c73aP-C5_2mMOJ3k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;As some of the early adopters may have already faced, JDK7 has changed some behaviors of the 'keytool' utility. Actually this is not specific to Android but sooner or later any Android developer might need to use key tool utility.&lt;br /&gt;
&lt;br /&gt;
In my case this has happened with the MapViewActivity. Those who had used MapView before will definitely remember that you need to provide an Api Key to retrieve maps. Google Maps offers a simple &lt;a href="http://code.google.com/android/maps-api-signup.html"&gt;signup&lt;/a&gt; mechanism and a detailed &lt;a href="http://code.google.com/android/add-ons/google-apis/mapkey.html"&gt;tutorial&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Actually all you need is to extract the fingerprint of the certificate which is used for signing your application.&lt;br /&gt;
&lt;br /&gt;
The following command will give you the certificate fingerprint.&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: #fafafa; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; font-size: 9pt; line-height: 15px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;"&gt;keytool -list -alias alias_name -keystore my-release-key.keystore&lt;/pre&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: #fafafa; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; font-size: 9pt; line-height: 15px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;"&gt;Certificate fingerprint (MD5): 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98&lt;/pre&gt;
&lt;br /&gt;
However those who had already downloaded and started using JDK7 will end up with SHA1 fingerprint instead of MD5.&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: #fafafa; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; font-size: 9pt; line-height: 15px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;"&gt;Certificate fingerprint (SHA1): 33:59:42:3D:74:CB:8F:AA:A9:C4:56:3D:16:4D:0E:13:68:FC:3C:2F&lt;/pre&gt;
&lt;br /&gt;
Since both fingerprints are in the same format and the only difference is the extra digits on SHA1, it might not be easy to understand you are not getting what you had asked for but the solution is quite simple.&lt;br /&gt;
&lt;br /&gt;
Either set your JDK version to 6 or add -v keytool command which would give you the MD5 instead SHA1.&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: #fafafa; border-bottom-color: rgb(187, 187, 187); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; font-size: 9pt; line-height: 15px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.99em; padding-left: 0.99em; padding-right: 0.99em; padding-top: 0.99em; word-wrap: break-word;"&gt;keytool -v -list -alias alias_name -keystore my-release-key.keystore&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-3512359039163425901?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/R3nqhEpZ0eI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/3512359039163425901/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=3512359039163425901" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3512359039163425901?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3512359039163425901?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/R3nqhEpZ0eI/android-vs-jdk7-first-act.html" title="Android vs JDK7; First Act.." /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/10/android-vs-jdk7-first-act.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcCRX0-eip7ImA9WhdbGU4.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-7928989283608036531</id><published>2011-10-16T22:08:00.000+02:00</published><updated>2011-10-18T13:24:24.352+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-18T13:24:24.352+02:00</app:edited><title>JavaOne.next();</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iWi_K8EDeZR69VOsJFumb6EL_a4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iWi_K8EDeZR69VOsJFumb6EL_a4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iWi_K8EDeZR69VOsJFumb6EL_a4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iWi_K8EDeZR69VOsJFumb6EL_a4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
Last year I wrote a very pessimistic blog post on Oracle's JavaOne which I never published and just wanted to give Oracle another chance. Since then Oracle did not really perform well in terms of community. Android lawsuit, the clash with Apache which caused them to leave JCP, replacement JCP nominations, dead of JavaFX script, a crippled JavaOne and the list goes on...&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
This year even when i step out of the plane I still did not have any good feelings or hopes on JavaOne. Honestly I wouldnt be attending if i did not have a session accepted.&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
However, despite I was ready ready to criticize each move, soon I realized there is a good progress. Oracle might have taken some bold an not really approved steps by the community but it seems like they had already done with that part and they really seem to move java forward. Still everything is not perfect but JavaOne is alive again and once again it is a conference worth to attend.&amp;nbsp;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
First of all Oracle really realized they are not communicating with the community. This year there was a good effort to do that. Arun Gupta and the Glassfish team were great on handling the JavaEE part. I must confess JavaEE6 should be the most underrated JavaEE version ever. It is quite mature, completed and has everything you may need to develop an enterprise project. Glassfish team did great with providing an east to setup reference implementation on Netbeans+Glassfish but did not stop there, very soon after the conference started we heard of JavaEE certified version of Tomcat, the TomEE. Even the TomEE team was quite surprised they had been certified that soon. This is a huge step! Tomcat is the most commonly used and accepted development server on non-vendor locked development world. A Tomcat with JavaEE capabilities would most probably drive more people to give JavaEE a chance against Spring and other frameworks. This might be the most clever move Oracle has ever made.&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
Donald Smith which you may know as &lt;a href="http://twitter.com/#%21/DonaldOJDK"&gt;@DonaldOJDK&lt;/a&gt;&amp;nbsp;performed a good success on replying most of the tweets and on the stage shows. Clearly bringing people with community and open source experience in is helping Oracle. Adam Bien also performed just like a good natural evangelist although he failed with a menly joke offending some women which an experienced rock star would never do. I think it was a bit exaggerated but still he had chance to correct it but he failed to.&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
It is quite clear JavaOne is missing something on the stage - specially in the keynotes - some rockstars. Ever remember James Gosling on stage talking on Java? the passion, the tech shows, t-shirt catapult... There needs to be fun and innovation on the stage which Oracle miserably failed this year by letting sponsors to perform keynotes. It was quite boring and awful. Oracle should really make a cease fire with formed rock stars and bring them on the stage no matter what! A JavaOne can never be a JavaOne without Gosling, Bloch... and others. However still they could do much better with what they already had. For example why not letting Simon Ritter hosting the keynotes? He is still an Oracle employee and had been there at the era of Sun. He was always behind the scenes on most of the SPOT, JavaFx or other geek demos just like this years kinect show. Why not just bringing him or people like him more on the stage.&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
JavaEE6 is great, Java7 with coin, fork&amp;amp;join is very thrilling, Java8 with lambda is exciting but Oracle, you really need to bring the old guns back in the stage to make JavaOne more fun, more innovative and more alive. Also running between sessions distributed to 3 hotels is not really a good conference experience. This year Oracle had a tremendous effort to organize this such as putting each track to a dedicated hotel and hiring stuff to show people their way but still 3 hotel conference area is no where near moscone. I do not really understand to schedule Oracle Open World and JavaOne on the same dates. Please Oracle just bring JavaOne back to Moscone.&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;
You don't need to license Java to Android or say sorry to Gosling. Just give them a hand to unite the community. I am very hopeful on JavaOne'12 and very happy that I didn't publish what I wrote on JavaOne'10 but I wish i would not be disappointed the next year. &amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-7928989283608036531?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/SMqHWWBaehI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/7928989283608036531/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=7928989283608036531" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/7928989283608036531?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/7928989283608036531?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/SMqHWWBaehI/javaonenext.html" title="JavaOne.next();" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/10/javaonenext.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMBR30zcSp7ImA9WhdVFk4.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-2512023028439275667</id><published>2011-09-21T21:47:00.001+02:00</published><updated>2011-09-21T21:47:36.389+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-21T21:47:36.389+02:00</app:edited><title>Ice Cream Sandwich for little ones?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/O3lHXrCZwcqC7CF_nBem7KQUH-k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/O3lHXrCZwcqC7CF_nBem7KQUH-k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/O3lHXrCZwcqC7CF_nBem7KQUH-k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/O3lHXrCZwcqC7CF_nBem7KQUH-k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;It is coming and probably very soon... There is an usual amount of activity related to optimizing apps for tablets and devices. Also Tim Bray from Google has also announced Euro Android Developer Labs today (september 21st) starting next week in first in Berlin (september 28,29) which will be followed by London and Paris. Thats way fast and so short notice.&lt;br /&gt;
Tim Bray will also be on stage for the keynote on the second day of Devoxx 2011. Although Google's contribution to Devoxx has increased since their decision of retrieving from JavaOne, being on stage at the keynote with droids all around might be for something big!&lt;br /&gt;
Ladies and Gentlemen please meet the Ice Cream Sandwich... soon, may be even sooner than iPhone5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-2512023028439275667?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/Kb3BzIixcRo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/2512023028439275667/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=2512023028439275667" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2512023028439275667?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2512023028439275667?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/Kb3BzIixcRo/ice-cream-sandwich-for-little-ones.html" title="Ice Cream Sandwich for little ones?" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/09/ice-cream-sandwich-for-little-ones.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIDRnkzfip7ImA9WhdVFEs.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5258754738196592844</id><published>2011-09-19T21:19:00.003+02:00</published><updated>2011-09-19T21:29:37.786+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T21:29:37.786+02:00</app:edited><title>I will be speaking at JavaOne 2011</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BoYjT0eakHDQiElU5xMvA_yLAFg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BoYjT0eakHDQiElU5xMvA_yLAFg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BoYjT0eakHDQiElU5xMvA_yLAFg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BoYjT0eakHDQiElU5xMvA_yLAFg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Last year, Oracle had invited me to JavaOne as press/blogger. Although this year again I was qualified for a blogger pass, I had already be attending to JavaOne as a speaker to give a talk on Eclipse's Osgi tooling called Libra.&lt;br /&gt;
&lt;br /&gt;
My session which is called 'OSGi for the Earthlings: Meet Eclipse Libra(24081)', is scheduled for October 3rd, monday 7pm at Park55 - Powell I/II. Also you may find me at Eclipse booth on the following days presenting some demos on Libra. If you are interested in OSGi or just want to meet, please stop by either my session or the eclipse booth so we may grab some beers and have some geek talk.&lt;br /&gt;
&lt;br /&gt;
See you at JavaOne..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5258754738196592844?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/z23FTCOyvyI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5258754738196592844/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5258754738196592844" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5258754738196592844?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5258754738196592844?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/z23FTCOyvyI/i-will-be-speaking-at-javaone-2011.html" title="I will be speaking at JavaOne 2011" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/09/i-will-be-speaking-at-javaone-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4NRnk-fip7ImA9WhdVFEg.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-7572799611236736359</id><published>2011-09-19T21:03:00.001+02:00</published><updated>2011-09-19T21:03:17.756+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-19T21:03:17.756+02:00</app:edited><title>flexjava.org transforming...</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VA3KDcjDCWGnEXFCMm54-7cETg4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VA3KDcjDCWGnEXFCMm54-7cETg4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VA3KDcjDCWGnEXFCMm54-7cETg4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VA3KDcjDCWGnEXFCMm54-7cETg4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;It has been over 4 years flexjava.org has been established. At first what I had in my mind was osting stuff about flex, java and things around them, however, this blog went far ahead covering many topics from android to ios and being invited to JavaOne twice!! So here comes time for a little change...&lt;br /&gt;
&lt;br /&gt;
Very soon you will find a new name which hopefully you like. Of course you can still reach us from flexjava.org domain and email addresses. Thanks everyone who have ever written or read a&amp;nbsp;post on flexjava... and wellcome ...hmm well, you'll see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-7572799611236736359?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/xLwRnkyglkE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/7572799611236736359/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=7572799611236736359" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/7572799611236736359?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/7572799611236736359?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/xLwRnkyglkE/flexjavaorg-transforming.html" title="flexjava.org transforming..." /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/09/flexjavaorg-transforming.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYAQnozcSp7ImA9WhdQFEQ.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5443393908926262601</id><published>2011-08-16T12:38:00.003+02:00</published><updated>2011-08-16T13:29:03.489+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-16T13:29:03.489+02:00</app:edited><title>Google buys Motorola... so what next??</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Edckyy-sirMLusHVicUqLBcRFhU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Edckyy-sirMLusHVicUqLBcRFhU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Edckyy-sirMLusHVicUqLBcRFhU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Edckyy-sirMLusHVicUqLBcRFhU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Google has acquired Motorola 12.5 billion dollars which is close to double the amount Oracle paid for Sun and Java. The acquision is mostly about the patents for mobile business which Google has under estimated so far. Actually this reminded me the blog post of former Sun CEO Schwartz.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;&lt;a href="http://jonathanischwartz.wordpress.com/2010/03/09/good-artists-copy-great-artists-steal/"&gt;In 2003, after I unveiled a prototype Linux desktop called&amp;nbsp;Project Looking Glass*, Steve called my office to let me know the graphical effects were “stepping all over Apple’s IP.” (IP = Intellectual Property = patents, trademarks and copyrights.) If we moved forward to commercialize it, “I’ll just sue you.” My response was simple. “Steve, I was just watching your last presentation, and Keynote looks identical to Concurrence – do you own that IP?” Concurrence was a presentation product built by Lighthouse Design, a company I’d help to found and which Sun acquired in 1996. Lighthouse built applications for NeXTSTEP, the Unix based operating system whose core would become the foundation for all Mac products after Apple acquired NeXT in 1996. Steve had used Concurrence for years, and as Apple built their own presentation tool, it was obvious where they’d&amp;nbsp;found inspiration. “And last I checked, MacOS is now built on Unix. I think Sun has a few OS patents, too.” Steve was silent. And that was the last I heard on the topic.&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;
&lt;/span&gt;... and the story goes...&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;&lt;a href="http://jonathanischwartz.wordpress.com/2010/03/09/good-artists-copy-great-artists-steal/"&gt;So that interaction was good preparation for a later meeting with Bill Gates and Steve Ballmer. They’d flown in over a weekend to meet with Scott McNealy, Sun’s then CEO – who asked me and Greg Papadopoulos (Sun’s CTO) to accompany him. As we sat down in our Menlo Park conference room, Bill skipped the small talk, and went straight to the point, “Microsoft owns the office productivity market, and our patents read all over OpenOffice.” OpenOffice is a free office productivity suite found on tens of millions of desktops worldwide. It’s a tremendous brand ambassador for its owner – it also limits the appeal of Microsoft Office to businesses and those forced to pirate it. Bill was delivering a slightly more sophisticated variant of the threat Steve had made, but he had a different solution in mind. “We’re happy to get you under license.” That was code for “We’ll go away if you pay us a royalty for every download” – the digital version of a protection racket. Royalty bearing free software? Jumbo shrimp. (Oxymoron.) But fearing this was on the agenda, we were prepared for the meeting. Microsoft is no stranger to imitating successful products, then leveraging their distribution power to eliminate a competitive threat – from tablet computing to search engines, their inspiration is often obvious (I’m trying to like Bing, I really am). So when they created their web application platform, .NET, it was obvious their designers had been staring at Java – which was exactly my retort. “We’ve looked at .NET, and you’re trampling all over a huge number of Java patents. So what will you pay us for every copy of Windows?” Bill explained the software business was all about building variable revenue streams from a fixed engineering cost base, so royalties didn’t fit with their model… which is to say, it was a short meeting.&lt;/a&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
So thats pretty much the reason, Google needed patents to defend themselves (and the partners) also since android has achieved a great success, it might be wise to jumo into hardware business and make few bucks out of it.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Till today Google released two Android devices with Google brand on it... the Nexus One and Nexus S. Both are reference implementations of the upcoming Android Os releases and great hardware but none were as appealing as Apple devices.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Google has choosen another strategy and stepback in implemantation release of Honeycomb and left it to Motorola with the Zoom. That time Samsung was questioning why Motorola had more access to new OS than any others who were also building devices.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Today everyone is congratulating Google for the buyout and defending its partners but very soon this acquision might bring if everyone has equal access to new sources. However if Google succeeds to keep Android as an open platform, it might just drive all other vendors to design great appealing devices as well as good hardware.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So good move Google, expensive but a clever move... Wonder if Apple would buy the USA as a countermove since they have that much cash.&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 14px; line-height: 23px;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5443393908926262601?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/x9bi-lo9Ucc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5443393908926262601/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5443393908926262601" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5443393908926262601?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5443393908926262601?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/x9bi-lo9Ucc/google-buys-motorola-so-what-next.html" title="Google buys Motorola... so what next??" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/08/google-buys-motorola-so-what-next.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EERXg9fip7ImA9WhdRF0k.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-4772705051136188340</id><published>2011-08-07T21:26:00.005+02:00</published><updated>2011-08-07T21:33:24.666+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-07T21:33:24.666+02:00</app:edited><title>So long Flex...</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hcCW4wEJ22_C1vznrIhvNULaeXk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hcCW4wEJ22_C1vznrIhvNULaeXk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hcCW4wEJ22_C1vznrIhvNULaeXk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hcCW4wEJ22_C1vznrIhvNULaeXk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I have been a supporter of Adobe Flex since version 2 beta, had developed on every version since then, received official trainers training, talked on implementing and developing flex apps many times, blogged and wrote magazine articles on Flex, gave Flex training and consulting to various clients and projects, try each beta on the day it was released, was one of the few people who made flex and blaze work on app engine, my blogs tutorials had been highlighed on sites like dzone... However I really lost my faith Flex which most probably Adobe also had.&lt;br /&gt;
&lt;br /&gt;
Since day 0, i found Flex/Actionscript to be a mutual UI alternative in Java universe. It was easy to learn, had great UI editor and lets you design with the customer, declerative, event oriented, great in cross browser compability and had a great and easy to install runtime. By the time Adobe bough Macromedia, Flash was already the leader in inteactive and rich Web content. Adobe had moved it one step forward by migrating flex development on eclipse by providing a classy plugin and also drove flash to each computer on the sphere by successfully supporting flash based streaming videos popularized by Youtube.&lt;br /&gt;
&lt;br /&gt;
Flex was so promising that very soon Microsoft introduced Silverlight and Sun striked back with JavaFX (shall we say applet 2.0). However Flex's maturity, easy learning curve, good set of resources, open source sdk (which both JavaFX and Silverlight failed), good community support, did not let its opponents to achieve any success. Very soon Oracle terminated JavaFX script and Microsoft announced they will use Js&amp;amp;HTML5 as the major development language in Windows 8. It was like a miracle to work on Flex at the age of JSF.&lt;br /&gt;
&lt;br /&gt;
Meanwhile on mobile side Adobe took it very slow. They failed to invest needed resources and support to build a mobile version of flash runtime for years. Mobile Flash, Flash Lite or whatever it is called has been just a rumor for long years (yes! years...). Then the iPhone era began, once again Adobe was not fast to adopt and when they were willing to put a runtime on iPhone, Jobs just refused. He claimed flash to be slow, power consuming, buggy and not ready to be used without a mouse pointer. Everyone including me accused Jobs not wanting Flash on iPhone to sell more apps but after seeing flash performing on Android, I am not really sure if Jobs is all wrong.&lt;br /&gt;
&lt;br /&gt;
Flash used to be awesome! it used to be on all platforms, running, installing and updating without any pain. Today as the rise of the mobile world Flash is suffering. They are not on iOS, crippled on Android and Blackberry and dropped linux to a second level citizen. 64bit flash has gone no far than a rumor just like mobile flash once... and Adobe had focused more on HTML5 tools like edge than updating the Flash experience. They had never able to release the linux version flex (flash) builder which was promised long ago.&lt;br /&gt;
&lt;br /&gt;
Although Adobe much invested in Android Development tools and build a first class tool set, the apps built on flex need 3rd party downloads and do not give the native feel to the user.&lt;br /&gt;
&lt;br /&gt;
Flash is still there, with video and audio streaming backed with old flash content like banners, ads etc... but nobody willing to do anything new with Flash, neither on mobile nor in full web. They had great set of tools and runtimes for all OSs and browsers (Flex, Air, Blaze, tool support) but they just could not adopt to change. So long Flex, it was both fun and great to code on... well me? i will just use GWT...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-4772705051136188340?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/4NftPoG9J8w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/4772705051136188340/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=4772705051136188340" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/4772705051136188340?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/4772705051136188340?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/4NftPoG9J8w/so-long-flex.html" title="So long Flex..." /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/08/so-long-flex.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUECQ3k9fSp7ImA9WhdTFUQ.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5212902455211044496</id><published>2011-07-14T00:54:00.000+02:00</published><updated>2011-07-14T00:54:22.765+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T00:54:22.765+02:00</app:edited><title>Why Open Source?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cbT3HnXU3mW2X3AdXf4FcaRCAGU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cbT3HnXU3mW2X3AdXf4FcaRCAGU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cbT3HnXU3mW2X3AdXf4FcaRCAGU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cbT3HnXU3mW2X3AdXf4FcaRCAGU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Why open source? Why would you need the source code of a software, a library or a framework? To cut it short you may just scroll to the last paragraph or just continue reading...&lt;br /&gt;
&lt;br /&gt;
Softwares, libraries or frameworks are usually intended to be used for the purpose of making something easier. So in perfect world no one should ever need to rework on that piece of code... Well not actually... Let's assume you are an end user (not related to any programing language) who had spend his hard earned money on a new computer. Even if you realize or not, you had already paid a vendor for an OS and also paid to some for a piece of graphics hardware which needs to have another piece of software (called driver) to run on your already paid OS. However in most cases you may end up with a situation in which those two softwares don't behave nice to each other. This situation might have easily been solved by each party or a computer geek who had bought same hw/sw bundle like you if there was a source to look for an error. Or lets say you are someone already related to software development (well probably, since you are reading this post) and you have been asked to develop something on a new sdk/library or a framework in which you end up with an error. This error is not necessarily been caused by that software structure but even if it is your fault, without being able to debug the source, you may not even realize it. Something similar has happened to a friend who had moved from .net platform to java to code something on sockets. He was a moderate developer who missed something but could easily find his fault when he debug the stream at byte level in the socket code, I still remember how thrilled he was to be able to browse the source. Also that software might also have a bug which you may have noticed and ask for a patch (or even patch yourself) if you had a chance to see the source. What about adding new or needed features to a software you had already paid for? (your ide or database or the mighty framework). What if there is something you need to add which is quite simple to code and would greatly improve your performance. Isn't that piece of software is something you had already purchased (or get free) just for similar purposes? Why now to be limited to less functionality while you can add more.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Using open source software does not necessarily mean you should also give your code to everyone. Also open sourcing your software does neither mean you need to give away everything free nor your code can be copy/pasted by anyone. It just means you have a nice poetry to show and someone may add few lines if they need to extend something and also you can always have some idea on whatever you are running on.&lt;br /&gt;
&lt;br /&gt;
Using a software without the source code is like getting a house without the permission to ever paint the walls. Once I wrote a comment to a &lt;a href="http://yakovfain.javadevelopersjournal.com/a_quote_on_the_open_source_software.htm"&gt;blog&lt;/a&gt; about open source software (which had been quoed at&amp;nbsp;&lt;a href="http://www.amazon.com/Enterprise-Development-Flex-Practices-Developers/dp/059615416X/ref=sr_1_2?ie=UTF8&amp;amp;qid=1310597525&amp;amp;sr=8-2"&gt;his book&lt;/a&gt;) who was asking why would someone insist on open source even if he knew he would never look at the code? Well... Open Source software is like airbags, nobody buy airbags to really use them but you can never know when would they save you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5212902455211044496?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/eGO0tVhsWiY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5212902455211044496/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5212902455211044496" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5212902455211044496?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5212902455211044496?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/eGO0tVhsWiY/why-open-source.html" title="Why Open Source?" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/07/why-open-source.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMEQ30-fSp7ImA9WhZWGUo.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-5949723033375922297</id><published>2011-05-21T13:13:00.000+02:00</published><updated>2011-05-21T13:13:22.355+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-21T13:13:22.355+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="io2011" /><category scheme="http://www.blogger.com/atom/ns#" term="Google I/O" /><title>After Google I/O</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/s-ZTAiqZw4V_Y-h3ALDCF9vFvdw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s-ZTAiqZw4V_Y-h3ALDCF9vFvdw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/s-ZTAiqZw4V_Y-h3ALDCF9vFvdw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s-ZTAiqZw4V_Y-h3ALDCF9vFvdw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;The greatest event of the year is over and once again I started making my plans for the next year. I must admit since 2009, every year I attend I see a better an more exciting event. This year the event was sold out just in 50 minutes and even myself barely got a last minute ticket. After 2010's two phone giveaway the expectations were high and rumors were around.&lt;br /&gt;
&lt;br /&gt;
This year something slightly changed. I/O is not gift for everyone conference anymore. Although they had given the marvelous Samsung Galaxy Tab 10.1 to everyone several sessions offered gifts only to their listeners. Also some vendors had their own after I/O events and had their own gift sessions. I was lucky to attend LG's 3D event to pickup a Optimus 3D phone. I must confess although i am not a 3D fan for movies and tv i am very impressed and excited about 3D phone which can shoot 3D content.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6gPYIOHI21k/TdVeaVkU4fI/AAAAAAAAAco/loQTjdLFPVw/s320/androidusb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-6gPYIOHI21k/TdVeaVkU4fI/AAAAAAAAAco/loQTjdLFPVw/s200/androidusb.png" width="185" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Unlike last year, this year IO had a better organised pre-conference event called Bootcamp. Bootcamp had 101 sessions on most of the conference topic and let developers had lab sessions and code side by side with google employees. One of the interesting topic on bootcamp was running PHP on Google App Engine. PHP is not natively supported and performed by the jvm &amp;nbsp;you will still face problems like can not querying sql and still need to connect to jdo/jpa from php.&lt;br /&gt;
&lt;br /&gt;
The IO kickoff with android logos floating around 5000 people in the keynote which is watched live all around the world. Keynote day 1 rocked the android world with the announcement of Open Accessories and the development kit. This will definitely be a huge leap in Android platform since this is something much different and bigger than made for iphone program which was aimed third parties to build accessories and speakers for the device. Open Accessories is definitely target much more than a pair of speakers and simple docks. Very soon our android devices will be tightly integrated with our homes, cars and other electronic equipments around us.&lt;br /&gt;
&lt;br /&gt;
Google IO also introduced us the Music Beta and Movies. Music Beta is a very interesting and new concept which would store whole your music on cloud, letting you to listen anywhere on any device. Movies would be offering similar service as other movie rental services but with an option of watching even when you are offline.&lt;br /&gt;
&lt;br /&gt;
Google IO keynote also had important news on Android OS. Version 3.1 is very close. Another great news is device manufacturers and operators agreed on bringing the latest firmware to their device as long as the hardware supports it. This will greatly decrease the fragmentation and most probably keep the market on two main OS versions (which was google's prediction and goal). Finally the great news! The new version of Android called Icecream Sandwich will be targeting all devices from phones to tablets.&lt;br /&gt;
&lt;br /&gt;
The keynote followed by great android sessions introducing the Open Accessories, going deeper into Honeycomb (by Chet Haase and Romain Guy), expert tips for Android development (Reto Meier) and finally the long waited NFC session. I must confess seeing the nfc tags in our badges really made me believe we would be getting nfc phones on the second day. With that much Android content I had no chance but to skip other stuff including GWT. Thanks to Google all those sessions we missed are available &lt;a href="http://www.google.com/events/io/2011/sessions.html"&gt;online&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Second keynote of the IO was all about news and announcements about Chrome Store and Chromebooks. Chromebooks are targeting to change the way we use and administer computers and also the way applications installed. Thw whole OS, applications and user accounts rely on cloud which may seem troublesome today. However in near future when internet connectivity will become even more stable.&lt;br /&gt;
&lt;br /&gt;
The second day of the event offered great HTML5 and GWT sessions as well as more Android sessions. &amp;nbsp;Some of the highlights were Android TV, bringing c and c++ games to android (where listeners received Sony Ericsson Experia Play) and High Performance GWT. Sadly I missed most of those but had chance to attend a private Developer Advocate event where we had chance to directly meet and talk to Google stuff. Listening Vic Gundotra's positive and sincere talk was really encouraging and inspiring. Seems like the following years Google will keep up the IO tradition both with the quality of sessions and gifts.&lt;br /&gt;
&lt;br /&gt;
IO 2011 is over and there are tons of session videos available to watch (even rewatch). So till next IO take your time watching the sessions and following events in your &lt;a href="http://www.gtugs.org/directory.jsp"&gt;local area&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-5949723033375922297?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/68Qtu7NilwA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/5949723033375922297/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=5949723033375922297" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5949723033375922297?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/5949723033375922297?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/68Qtu7NilwA/after-google-io.html" title="After Google I/O" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-6gPYIOHI21k/TdVeaVkU4fI/AAAAAAAAAco/loQTjdLFPVw/s72-c/androidusb.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/05/after-google-io.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIAQHg9fip7ImA9Wx9aFks.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-6791599577951740585</id><published>2011-03-09T11:39:00.000+02:00</published><updated>2011-03-09T11:39:01.666+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-09T11:39:01.666+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google I/O" /><title>Last Call for Google I/O</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QycUgUB8KFcGfOH_7wWM3cmvrWI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QycUgUB8KFcGfOH_7wWM3cmvrWI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QycUgUB8KFcGfOH_7wWM3cmvrWI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QycUgUB8KFcGfOH_7wWM3cmvrWI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;This year I/O sold out less than an hour leaving many really interested developers out of the conference. There has been talks and posts about people registered to the conference just for goodies even they are not interested in I/O.&lt;br /&gt;
Thats why it is great to see Google is offering a new chance just for real developers for a chance to get a ticket. I suspect this tickets are the ones which most people got http request error during registration but the server got their session on hold. I had such an experience and later completed my registration.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://sites.google.com/site/lastcallforio2011/Home"&gt;Check for te details and don't miss I/O...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-6791599577951740585?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/bn5K_IS9tVs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/6791599577951740585/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=6791599577951740585" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6791599577951740585?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/6791599577951740585?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/bn5K_IS9tVs/last-call-for-google-io.html" title="Last Call for Google I/O" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2011/03/last-call-for-google-io.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIMR3c4eSp7ImA9Wx9REUs.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-1798998542341003690</id><published>2010-12-12T17:26:00.000+02:00</published><updated>2010-12-12T17:26:26.931+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-12T17:26:26.931+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jcp" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle" /><category scheme="http://www.blogger.com/atom/ns#" term="apache" /><title>Apache quits JCP, begun the clone wars has...</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Jpsue8deDT8VJ2gobjbHB_ZlulM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jpsue8deDT8VJ2gobjbHB_ZlulM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Jpsue8deDT8VJ2gobjbHB_ZlulM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Jpsue8deDT8VJ2gobjbHB_ZlulM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;This was something expected but still shaking. Apache who had great contributions to Java and JCP and had been choosen JCP member of the year several times left JCP. &lt;a href="http://www.apache.org/jcp/sunopenletter.html"&gt;Since from Sun era, Apache had a clash on TCK license for Apache Harmony project&lt;/a&gt;. Actually about a month ago at devoxx keynote panel things became more clear when Joshua Bloch talked about Oracle's reaction behind close doors.&lt;br /&gt;
After the JSRs for Java7 voted, Apache finally made the expected move and quit the JCP and the executive commitee.&lt;br /&gt;
JCP might not have been a responsive and effective organization but still it was something important for the community. I extremely agree this &lt;a href="http://yakovfain.javadevelopersjournal.com/how_many_women_does_it_take_to_cook_borsch.htm"&gt;post&lt;/a&gt;&amp;nbsp;on how JCP was ineffective. However this separation would change things on Java world forever. This seperatists movement will make forking of Java official which had been in progress for long. The community will probably follow apache, android and other Java likes where the business will follow Oracle and EE standarts.&lt;br /&gt;
Oracle is planning good stuff for Java but definitely they have no idea on community relations. This is the only response on &lt;a href="http://blogs.oracle.com/henrik/2010/12/oracle_response_to_apache_departure_from_jcp.html"&gt;Oracle&lt;/a&gt; side while &lt;a href="https://blogs.apache.org/foundation/date/20101209"&gt;Apache&lt;/a&gt; clearly showed their reasons. Please Oracle hire someone to keep up the community relations and please tell your lawyers to let him free.&amp;nbsp;&amp;nbsp;Or is this just like Palpatine's plan to push a seperatist movement to make legal excuse for the war?&amp;nbsp;Whatever it is, this is not a victory and begun the clone wars has...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-1798998542341003690?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/g2tnoxTrY34" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/1798998542341003690/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=1798998542341003690" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/1798998542341003690?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/1798998542341003690?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/g2tnoxTrY34/apache-quits-jcp-begun-clone-wars-has.html" title="Apache quits JCP, begun the clone wars has..." /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2010/12/apache-quits-jcp-begun-clone-wars-has.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICQH8zeCp7ImA9Wx9SEkQ.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-3105159876388420760</id><published>2010-12-02T15:40:00.001+02:00</published><updated>2010-12-02T15:46:01.180+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-02T15:46:01.180+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="swt" /><title>org.eclipse.swt.SWTException: Invalid thread access</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lc10KV3inK4HWgAjNRnMhGY5C1Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lc10KV3inK4HWgAjNRnMhGY5C1Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lc10KV3inK4HWgAjNRnMhGY5C1Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lc10KV3inK4HWgAjNRnMhGY5C1Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px; line-height: 16px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Eclipse plugin development may introduce new set of exceptions to your life but actually this one is familiar. Just like most other UI architectures SWT, thus eclipse offers a single threaded UI model. Nature of working with in plugins may confuse in which thread you are but eclipse will definitely and politely remind you by raising an "org.eclipse.swt.SWTException: Invalid thread access" exception.&lt;br /&gt;
&lt;br /&gt;
Although most the exceptions you may face&amp;nbsp;during plugin development can be quite tricky, this is one is quite well documented and well known, even in&amp;nbsp;&lt;a href="http://www.eclipse.org/swt/faq.php#uithread" style="color: #336699; text-decoration: none;"&gt;SWT faq&lt;/a&gt;.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Briefly the code block needs to deal with the UI thread should be running within the following block:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;code style="font-family: 'Courier New', Courier, monospace; font-size: 11px;"&gt;Display.getDefault().syncExec( new Runnable() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; public void run() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;//access UI stuff&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
});&lt;/code&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Simple? Just keep in mind, SWT is a single threaded UI model just like awt, swing or most of the others.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-3105159876388420760?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/YCsrPAiexVo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/3105159876388420760/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=3105159876388420760" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3105159876388420760?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/3105159876388420760?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/YCsrPAiexVo/orgeclipseswtswtexception-invalid.html" title="org.eclipse.swt.SWTException: Invalid thread access" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2010/12/orgeclipseswtswtexception-invalid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08MQH0_eyp7ImA9Wx5WFU4.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-2749206801403695288</id><published>2010-09-27T01:24:00.002+03:00</published><updated>2010-09-27T01:24:41.343+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-27T01:24:41.343+03:00</app:edited><title>JavaFX dead, Long live JavaFX…</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eqcqNCX-ELl6wn_hFGj7DhnhvYw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eqcqNCX-ELl6wn_hFGj7DhnhvYw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eqcqNCX-ELl6wn_hFGj7DhnhvYw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eqcqNCX-ELl6wn_hFGj7DhnhvYw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;For the last 3 javaones javafx managed to keep as the most popular topic. This year again there were promising javafx demos but also bundled with some shocking news.&lt;br /&gt;
Oracle has taken a bold step and decided to kill javafx, well at least the javafx script part. The tecnology still keeps the javafx name, however, without the declerative scripting counterpart nobody really knows how will it differ than swing and applets. Javafx script made nice start and offered promising future. Unlike its xml based rivals flex and silverlight, javafx adopted a css like declerative scripting. JavaFX also managed to have a public display of rich website of the last winter olympics.&lt;br /&gt;
Meanwhile, JavaFX failed to offer progress and tool support, thus failed to gain developer and community support. Although it was all java, different sytax and usage was not well atopted and made flex an easier learning path.&lt;br /&gt;
This year javaone keynote also introduced hard to believe javafx demos, but also brought the news that the scripting engine is not supported anymore and there wil not be any porting for javafx 2.0 . This led questions from java developers who felt left in dark. If anyone invest in learning javafx now, or even use their already gained experience, they are going to produce code which will not be supported in the new sdk. However nobody exactly know when the new sdk will be ready for production and how complete will it be? Also leaving declerative syntax behind and adopting a swing/gwt like style may also not be the best choise in the era of declerative uis. When compared to xml in flex, silverlight and even android, building your ui by code is not really attractive.&lt;br /&gt;
&lt;br /&gt;
Oracle really took a bold move by making catastrophic changes which may bring life to javafx. They are completely rewriting and reengineering javafx but they lost very talented people from java, swing, javafx etc.. Who both knew java and the previous implementatins well (just to name few, Chet Haase, Romain Guy, Josh Marinacci). Honestly ireally think Oracle needs a UI product like javafx in their techonology stack and they are aware of this. However this move also left all current javafx development and developers in dark with some promises on future. Well we will see how much the "Future&lt;javafx&gt;" will work javafx in java community.&lt;/javafx&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-2749206801403695288?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/Nw-EtYe5h18" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/2749206801403695288/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=2749206801403695288" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2749206801403695288?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2749206801403695288?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/Nw-EtYe5h18/javafx-dead-long-live-javafx.html" title="JavaFX dead, Long live JavaFX…" /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2010/09/javafx-dead-long-live-javafx.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQCSH49fip7ImA9Wx5XFEQ.&quot;"><id>tag:blogger.com,1999:blog-86471091124760110.post-2096354511310556685</id><published>2010-09-14T23:49:00.000+03:00</published><updated>2010-09-14T23:49:29.066+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-14T23:49:29.066+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Flex 4" /><category scheme="http://www.blogger.com/atom/ns#" term="Burrito" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash Builder" /><title>Hungry to Flex? Welcome Burrito...</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1jQ4CDooG82VW8ocQTGMG60CHtI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1jQ4CDooG82VW8ocQTGMG60CHtI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1jQ4CDooG82VW8ocQTGMG60CHtI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1jQ4CDooG82VW8ocQTGMG60CHtI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Those who have migrated to Flash Builder 4, has already should notice developer friendly enhancements in the IDE. However Flash Builder is still far from being perfect when ActionScript editor capabilities are compared to Java editor but the progress goes on... Adobe has just published a video of showing nice editor enhancements of Flash Builder.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="0" height="250" src="http://player.vimeo.com/video/14746937?title=0&amp;amp;byline=0&amp;amp;portrait=0" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;a href="http://vimeo.com/14746937"&gt;Flash Builder Burrito - Generate from Usage&lt;/a&gt; from &lt;a href="http://vimeo.com/ashorten"&gt;Andrew Shorten&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Adobe might have released Flex 4 and Flash Builder (spark mobile issues, missing spark components... etc) before they are complete but seems they are catching up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/86471091124760110-2096354511310556685?l=www.devchronicles.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DeveloperChronicles/~4/opHZ3vdY56c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.devchronicles.com/feeds/2096354511310556685/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=86471091124760110&amp;postID=2096354511310556685" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2096354511310556685?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/86471091124760110/posts/default/2096354511310556685?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DeveloperChronicles/~3/opHZ3vdY56c/hungry-to-flex-welcome-burrito.html" title="Hungry to Flex? Welcome Burrito..." /><author><name>Murat Yener</name><uri>https://profiles.google.com/114028338330916709688</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-RPFXS90xZGI/AAAAAAAAAAI/AAAAAAAABbQ/njz3FJYGszQ/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.devchronicles.com/2010/09/hungry-to-flex-welcome-burrito.html</feedburner:origLink></entry></feed>

