<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Comunidade Portuguesa de Rich Internet Applications &#187; João Saleiro</title>
	<atom:link href="http://www.riapt.org/author/joaosaleiro/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.riapt.org</link>
	<description></description>
	<lastBuildDate>Sun, 15 Jan 2012 15:48:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Depois de 6 anos de Flex, irei migrar para HTML5?</title>
		<link>http://www.riapt.org/2012/01/13/depois-de-6-anos-de-flex-irei-migrar-para-html5/</link>
		<comments>http://www.riapt.org/2012/01/13/depois-de-6-anos-de-flex-irei-migrar-para-html5/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:57:11 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=972</guid>
		<description><![CDATA[Regra geral não sou apologista de dispersar conteúdo, nem de fazer posts no riapt em Inglês. Neste caso em específico, visto tratar-se de um assunto que está na ordem do dia, vou abrir uma excepção e duplicar aqui um post que fiz no Google+. O endereço original é este: https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs . Aconselho vivamente a leitura deste post no [...]]]></description>
			<content:encoded><![CDATA[<p>Regra geral não sou apologista de dispersar conteúdo, nem de fazer posts no riapt em Inglês. Neste caso em específico, visto tratar-se de um assunto que está na ordem do dia, vou abrir uma excepção e duplicar aqui um post que fiz no Google+. O endereço original é este: <a href="https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs">https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs</a> . Aconselho <strong>vivamente </strong>a leitura deste post no link original, pois o original é actualizado regularmente com pequenas correcções ortográficas.</p>
<h1></h1>
<h1></h1>
<h1>After 6 years doing Flex, am I moving to HTML5?</h1>
<p>Short answer: no. But I&#8217;m investing in HTML5.<br />
(really) Long answer: see below.</p>
<p>After coming back from the Flex Summit, many people have contacted me asking what was going to happen with Flex and if I was going to &#8220;migrate&#8221; our projects (like <a href="http://airgile.com">http://airgile.com</a> ) and services to HTML5. After plenty of exchanged emails and dozens of long talks, I decided to write down and share some notes of my first steps in the HTML5 world regarding the development of Enterprise RIAs (or not). These notes are not organized, they have typos, and, as I said above &#8211; they are only my first steps so more experienced people might (and will) prove me wrong in some topics.</p>
<h2></h2>
<h2>Background</h2>
<p>I founded Webfuel in 2004 and since then we&#8217;ve specialized in building long-term (&gt; 6 months) enterprise-grade RIAs that had to scale well and be prepared for constantly changing requirements with a low cost in maintainability, while simultaneously providing a top-notch user experience. We&#8217;ve managed to offer our services comfortably with a very limited number of resources and small development teams (3-5 persons per project), much thanks to the way we leveraged existing knowledge on Software Engineering and applied it to our platform of choice &#8211; Adobe Flex (now fortunately called Apache Flex).<br />
Our decision was purely technical and we have never regretted our choice, until it got badly affected by the bad PR around the Flash platform.</p>
<h2></h2>
<h2>Worse PR ever in November 2011</h2>
<p>The Flash platform was already in bad shape, much thanks to one year of chaotic PR and there were already some inconsistent signs from Adobe. While disappointed, I was not very surprised when all hell broke loose in November 2011 with Adobe destroying the very last credibility that Flash still had, directly affecting Flex, our businesses and careers. Long story short, Adobe wasn&#8217;t able to monetize the Flash Platform and the top managers who don&#8217;t really care or understand its power simply decided to put the money where their mouth was: HTML5. I happen to strongly agree with the move on investing in HTML5, but they could and should have done it without destroying (the perception of) Flash. Especially because in the meanwhile it had turned into the platform of choice for Enterprise Development.</p>
<p>In December &#8217;11 Adobe has donated Flex to Apache. While this might end up in being the best thing that could happen to Flex, the initial reaction from the Enterprise was that Adobe was getting rid of Flex. Like someone said during the Flex Summit &#8211; &#8220;it seems to me that Adobe has built the best platform for enterprise-grade application by accident&#8221;. Adobe understands design; creativity; marketing; publishing; Adobe doesn&#8217;t seem to understand Enterprise. Example #1: Zero Support = the biggest complaint about Adobe I heard for years on the Enterprise. Example #2: the pricing of LCDS.</p>
<p>Did Adobe kill Flex? No! A technology doesn&#8217;t have a heart attack and drops dead on the floor. Flex is still alive and the reasons why we chose it are still <strong>perfectly valid</strong>. Flex didn&#8217;t get worse suddenly &#8211; it&#8217;s still the same robust platform for enterprise RIA development.<br />
What Adobe destroyed was perception of the Flash Platform. And the perception is what matters on business. You can have the best product of the world, but if people believe it&#8217;s bad they won&#8217;t buy it (and they&#8217;ll even be happy on telling everyone how much your product &#8211; that they never used &#8211; sucks). But if they think it&#8217;s good &#8211; even if it actually sucks &#8211; they&#8217;ll probably buy it (and complain later). Perception. That&#8217;s what sells. Perception.</p>
<p>Will the perception around Apache Flex ( <a href="http://incubator.apache.org/flex/">http://incubator.apache.org/flex/</a> ) improve? Most likely, yes. In 9 days, there were more than 1.4 thousand emails exchanged on the Flex Mailing List ( <a href="http://incubator.apache.org/flex/mailing-lists.html">http://incubator.apache.org/flex/mailing-lists.html</a> ) ! It&#8217;s pretty impressive the number of people that are now involved in pushing Flex forward and this number will most likely keep rising. But Apache Flex still relies (or, at least for now) on the Flash Platform and I&#8217;m not seeing the bad perception on the Flash Player changing in a near future. Of course there&#8217;s still AIR, but what concerns me are browser applications.</p>
<h2></h2>
<h2>We are desktop-developers-working-on-the-web</h2>
<p>An important side note, is that I see Webfuel as a team of desktop developers working on the web. In other words, we use desktop development paradigms, best-practices and design patterns borrowed from the JAVA world and we&#8217;ve applied them to build applications that happen to run inside the browser. Our work consists normally in building at least two loosely coupled applications, connected by an RPC API: a client application (running inside the web-browser) and a server application that only exposes services and is not aware of the client application.</p>
<p>Most Flex developers out there think on themselves as web-developers, but in most cases the mindset of a Flex developer is closer to a desktop developer than to a web developer. IMHO, this is the most single-most-important reason on why we, Flex developers, dislike so much the &#8220;normal&#8221; web development approaches.<br />
We work with &#8220;views&#8221;, web developers work with &#8220;documents&#8221;. We do old-school MVC, DI, loosely coupled approaches, dependency management, RPC, code coverage, continuous integration [...], and when we&#8217;re forced to do web-development these are the first concepts that we try to investigate and replicate&#8230; before we get frustrated and enter in &#8220;denial&#8221;.<br />
To be good at typical web-development, we have to <strong>change our mindset</strong>.</p>
<h2></h2>
<h2>Is &#8220;HTML5&#8243; ready?</h2>
<p>According to Twitter, online magazines, blogs, Apple, Microsoft and even Adobe, HTML5 is the silver-bullet for everything. It can be used to build websites, webapps, games, software, mobile applications, doing laundry and cooking. The focus is all on HTML5 right now. Is it the right moment to use it?</p>
<p>From the point of view of a web-developer &#8211; of course it is!!! For a typical web-developer, HTML5 means more tools, more power and much better cross-browser compatibility than what they had before. If you&#8217;re working on the web, HTML5 and the storm of JS frameworks is simply the best thing that has happened to the web since&#8230;. humm&#8230; Flash. <img src='http://www.riapt.org/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ) Bottom line, HTML5 is for sure a giant step forward.</p>
<p>From the point of view of desktop-developer-working-on-the-web &#8211; hell no! WTF? We work on the enterprise and enterprise means stability. We can&#8217;t afford to have too many moving pieces all the time. We can&#8217;t afford to deal with un-structured languages. If you&#8217;ve used Flash or Flex for the last 5 years, you&#8217;ll feel that in HTML5 there&#8217;s nothing new or better than what you already have. Worse, you&#8217;ll feel that there still are hundreds of needed capabilities and tools missing. Exception to the rule, happens if you&#8217;re targeting the browser of Mobile devices, where HTML5 is king.<br />
It&#8217;s quite understandable that a Flex developer feels frustrated. You feel you&#8217;re going backwards 4 or 5 years. It happens that, as Ted Patrick stated (<a href=" http://tedpatrick.com/2011/11/12/living-in-the-future/"> http://tedpatrick.com/2011/11/12/living-in-the-future/</a> ) , we were living in the future&#8230;</p>
<h2></h2>
<h2>Ignore the shit storm. Ignore fanboys. Choose the right tools. Ask the right questions to the right developers</h2>
<p>People like to take sides. If I like and use something, for sure it&#8217;s because it&#8217;s the best thing ever, and all the rest sucks or is dead. That&#8217;s how it works for most fanboys.<br />
Newsflash: if 10.000 persons say that something sucks, it doesn&#8217;t really mean that it really sucks. It means that they believe it sucks. Like believing in a religion. The irony is that developers should be pragmatic people, but we often see them becoming fanatic about their technology choices. &#8220;Infidel, infidel&#8221;, they yell with their pitchforks in the air when you say the name of a &#8220;competitor&#8221; technology. WTF?</p>
<p>For me, technologies are just tools. Obviously I would like to have as many good tools as possible so I can be able to choose the right one for each task. Be it Flex, HTML5, Javascript, Actionscript, JAVA, PHP, whatever.</p>
<p>Bottom line: ignore the shit storm and the bad PR. Ignore fanboys. Choose your tools based on logic. You wouldn&#8217;t choose a hammer to cut wood, would you?</p>
<p>Last year, when I started digging seriously into Javascript, I had many questions. I took for granted that someone who defends a technology with so much conviction, probably understands it pretty well. So I placed several questions to these guys expecting to learn new stuff and understand their best practices. It happens that I haven&#8217;t learnt shit. It was like if me and they were from different planets, speaking different languages. Even similar words have different meanings (their MVC is not our MVC. their dependency management is not our dependency management&#8230; etc).</p>
<p>I&#8217;ve sent a couple of emails to mailing lists of HTML5 and JS development asking people what they were using for MVC, IoC, Unit Testing, Code Coverage, Compiling, Continuous Integration, etc, etc. The answers were like &#8220;WTF dude, IoC? What are you talking about?&#8221;. I now know that I was doing the wrong questions, as you&#8217;ll see below.</p>
<p>Since I couldn&#8217;t get (or understand) answers from the gurus of the JS world, I started trying to find people who were doing both large-scale Actionscript and Javascript. They would understand me. <img src='http://www.riapt.org/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ) It happens that there aren&#8217;t many and most of them were more or less at the same point I was. The best single advice I got was: &#8220;accept web dev for what it is and don&#8217;t try to change it. Don&#8217;t do RIAs. Do simple web development. Then improve.&#8221;. Good advice!.</p>
<h2></h2>
<h2>Redefining our focus</h2>
<p>As I said above, technology-wise, Flex is still perfectly valid. But it&#8217;s perception is at its lowest level and clients are quite confused and started asking us to use HTML5 to build the same type of solutions we were building with Flex.</p>
<p>So we had to rethink our business, and considering our desktop-developers-working-on-the-web mindset, we&#8217;ve decided to:</p>
<p>1- return to our roots: desktop development. That&#8217;s what we&#8217;re good at and we can still keep using Flex to build AIR applications, either for the desktop or mobile. Since we can embed the AIR runtime, those applications will be future-proof to any other crazy-game-changing decisions made by Adobe.<br />
2- increas our investment in developing (simple) HTML(5) webapps, while accepting the web for what it is: broken. In another words, we have to be humble about what we can provide on the web. It&#8217;s too hard and expensive to build the same type of applications we were building, so we&#8217;re starting with just simple webapps.</p>
<p>We won&#8217;t be accepting huge enterprise-grade projects if they&#8217;re meant to be built in HTML(5). This is actually the hardest problem to manage. There are expectations from clients. They&#8217;ve gotten used to our beautiful RIA applications, with almost no waiting times, with beautiful and pixel-perfect interactive user interfaces. And now they want the same, but in HTML5, because Flash is &#8220;dead&#8221; and HTML5 will also run on their Mobile devices (all of them), faster and without consuming battery. At least, it&#8217;s what they heard&#8230;. The solution for this problem is to say &#8220;No, we are not ready to develop it in HTML5&#8243;. We&#8217;ll be restricting our development to simpler web-apps, until we feel that we (and the web) are ready.</p>
<h2></h2>
<h2>First steps in JS and HTML5</h2>
<p>During 2011, I&#8217;ve read <strong>A LOT</strong> about JS frameworks, libraries, approaches, etc. Sometimes, after finishing reading something, it was already outdated and a better library was available.</p>
<p>My first impression was that most docs were &#8220;meh&#8221;: in most cases you have an excellent &#8220;Getting Started&#8221; guide, but as soon you start getting your hands dirty in more complicated scenarios, things start falling apart and you&#8217;ll see no or outdated advanced documentation.</p>
<p>Another trend that I hated in my readings was the lack of objectivity: instead of the typical docs saying &#8220;this framework does A,B,C,D&#8221; , I saw a lot of &#8220;THIS IS THA MOTHA-FUCKA FRAMEWORK THAT WILL SAVE UR LIFE!&#8221;, &#8220;MEGA-HYPA-SHIZZLA-FRAMEWORK&#8221;. Feels awkward.</p>
<p>I&#8217;ve also seen several frameworks being dropped in favor of others, which was actually what scared me the most. I felt insecure choosing the &#8220;right&#8221; libs and frameworks, so most choices I did at start were the safe ones, as you&#8217;ll see below.</p>
<p>Another irony was that most of the JS frameworks exist to overcome the limitations of the web development (normally, the crossbrowser issues). Coming from an environment where a framework tries to abstract application concepts, it felt weird to me to use frameworks to abstract technical limitations. Today, I&#8217;ve learnt to enjoy and welcome these frameworks. Accept them for what they are, because the technical limitations actually <strong>exist</strong> and without those frameworks you&#8217;re screwed.</p>
<div style="text-align: left;">In October 2011, I decided to start a medium sized real-life HTML5 webapp with a partner company, so we could test the knowledge I gathered. (A medium-sized project in the point of view of a web-developer; as a desktop-developer I see it as simple stuff <span style="font-family: Arial;"><span style="line-height: normal;">#notBeingHumble</span></span>  ). I&#8217;ve allocated two developers to the project &#8211; with myself being one of them. Below are the choices we did.</div>
<h2></h2>
<h2>Knockout.js</h2>
<p>Despite having read about Backbone, Spine and other complicated frameworks, I&#8217;ve decided to start small and simple with Knockout.JS . I just wanted simple data-binding to start with, so I could get some separation between the data model and the view. Later, when we were more experienced, I would re-evaluate the choice of the framework and choose between Backbone, Spine, or another.</p>
<p>My choice has proven to be worthy since Knockout is actually quite simple &#8211; but far more complicated and intrusive than the ultra-easy and powerful binding we&#8217;re used to in Flex.</p>
<p>The documentation of Knockout is quite good, with plenty of tutorials available. On Google you won&#8217;t find as many resources on Knockout as you would like, but fortunately the website covers most of the important topics. The mailing list is pretty good, despite not being as active as the MLs I&#8217;m used to in the Flex world with dozens or hundreds of experts. Anyway, in the Knockout ML, there were always one or two people kind enough to point you in the right direction, which is great.</p>
<h2></h2>
<h2>jQuery</h2>
<p>I had already a good impression on jQuery, but even still it turned up to be even better than what I expected. jQuery not only hides a lot of the crossbrowser issues &#8211; not all -, but also boosts up a lot your productivity with dozens of shortcut functions to most of the stuff people normally need to do on the web. Use it (can you live without it?).</p>
<h2></h2>
<h2>SaaS</h2>
<p>Managing CSS can easily turn into a pain especially if you need to do many changes to an existing stylesheet with hundreds of CSS declarations. When Googling for best practices, I met SaaS. SaaS is actually pretty simple: it lets you define CSS stylesheets with declaration hierarchy, variables and mathematic expressions, saving them on a scss file. Then you start a command line task that listens to changes to your scss file and converts it to a CSS file on the fly.</p>
<p>I haven&#8217;t looked at Less, so I don&#8217;t really know which one is better.</p>
<h2></h2>
<h2>Lab.JS</h2>
<p>I also discovered (the hard way) the pain that it can be to manage dependencies in Javascript. I was used to having all class definitions packaged for me in a single SWF and the Flash VM would take care of embedding and managing dependencies for me (pretty most like all bytecode VMs do). In the Javascript world, there&#8217;s nothing taking care of this for you. You start by setting in the HTML file the location of the scripts needed, but then you cannot control the order they are loaded and run. So you can be calling a function myFunction() in fileB.js that was defined in fileA.js that was not loaded yet &#8211; resulting in errors.</p>
<p>I&#8217;ve chosen Lab.JS to solve the issue of loading dependencies on the right order. I&#8217;m also making sure that any initialization code only runs AFTER all the needed files are loaded.</p>
<p>I&#8217;ve found a problem with Lab.JS: if your code throws exceptions, they will be swallowed by the library and nothing happens. My workaround (read: ugly hack) was to do a &#8221; setTimeout(initialize, 1); &#8221; after the scripts are loaded. This way exceptions are now caught by the browser, as you would expect.</p>
<h2></h2>
<h2>IDEs</h2>
<p>This was one of the biggest disappointments in the beginning. The biggest problem of JS is that due to its dynamic nature it&#8217;s hard to be tooled around. For building large scale complex systems, especially in a team environment, I needed good refactoring capabilities. It happens that refactoring doesn&#8217;t exist in the IDEs I tried.<br />
Ok, there is something called &#8220;rename&#8221; in WebStorm but it works for very simple cases and I&#8217;ve seen it resulting in unexpected results (so I always use the &#8220;preview&#8221;).</p>
<p>Flash Builder is a complete beast (in a good sense). I&#8217;ve seen many people ranting on Flash Builder and even I had some disappointments a couple of years ago. But after FB 4 it just got awesome, with its serious refactoring capabilities, find usages, metadata completion, autocomplete, inline docs, content assist, etc. Most of the best tricks from the JAVA world are available on FB. If you expect to find those in JS editors, I have bad news for you.</p>
<p>I&#8217;ve started with Aptana. It&#8217;s free. It&#8217;s based on Eclipse, so I felt at home at least with the shortcuts and the structure of the IDE, but with a black editor (wtf? is this the &#8220;fashion-color&#8221; for supa-dupa-web-developers?). Anyway, after two months I got tired of it. I couldn&#8217;t do refactoring. I couldn&#8217;t jump properly to a function definition with CTRL+click (and this was REALLY annoying). It didn&#8217;t have decent auto-complete. I&#8217;ve tried making the debugging work but it only worked properly 15% of the time.</p>
<p>Then I&#8217;ve decided to give PHPStorm a try &#8211; which is the same as WebStorm, but also supports PHP. At first, I was scared: I couldn&#8217;t find half of the stuff I needed. After one day, I was pretty comfortable with it and now I feel it&#8217;s actually pretty well built. Ok, it&#8217;s NOT Eclipse, but even still it&#8217;s quite powerful. What those guys did was to implement <strong>really well</strong> the things you use most while developing and packaged all of them in a clean and objective interface. Kudos to JetBrains ( <a href="http://www.jetbrains.com/">http://www.jetbrains.com/</a> )!<br />
In PHPStorm, refactoring &#8220;sorta&#8221; works in simple scenarios. If you complicate too much (like when you try to mimic packaging for your objects), it won&#8217;t work. Click and jump to a function definition works. Debugging&#8230; works!! Autocomplete works a lot better than I expected. Actually, it works quite well. The catch: comparing to Aptana, it&#8217;s not free.<br />
Coming from Flash Builder, will you be happy with PHPStorm? No. But currently it seems to me that it is probably the best IDE for Web development.</p>
<h2></h2>
<h2>Debugging</h2>
<p>I feel ashamed to say that I couldn&#8217;t debug properly during the first two to three weeks. Every tool I tried didn&#8217;t work as expected. It happens I was using the wrong tools, browsers and approaches.<br />
I ended up using the debugging capabilities of both Firebug (in Firefox!) and PHPStorm. Firebug is also pretty helpful to inspect the DOM of the document, something you&#8217;ll be doing every 5 minutes. Both Firebug and PHPStorm allow you to place a breakpoint in JS code and then run your code step by step, as expected. PHPStorm looks more comfortable to me, also because it&#8217;s where I&#8217;m writing my code.<br />
Bottom line: If your debugging is not working, don&#8217;t blame JS: you&#8217;re simply using the wrong tools.</p>
<h2></h2>
<h2>Javascript</h2>
<p>This was probably my biggest pain point. I&#8217;ll start with the conclusions: accept Javascript for what it is and don&#8217;t try to mimic your common OOP techniques and classes. There.are.no.real.classes.in.javascript.<br />
Of course, you can <strong>try</strong> to mimic them &#8211; I&#8217;ve read half of a book teaching how to do that. But I&#8217;ve come to the conclusion that the complexity that you&#8217;re adding to get you closer to your comfort zone ends up not being comfortable at all&#8230;<br />
You have objects in Javascript. Some might argue that they&#8217;re not &#8220;real objects&#8221;, but wtf, they are what they are and bitching around all the time won&#8217;t turn them into real objects. They are objects. It&#8217;s the definition of &#8220;real&#8221; that is subjective <img src='http://www.riapt.org/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
<p>The problems with JS:</p>
<p>- Silent errors. They happen. Get ready for them.<br />
- Hard coupling everywhere. It&#8217;s pretty hard to do loosely coupled architectures. It&#8217;s quite easy to end up with a web of dependencies between different objects. I&#8217;ve read there are techniques to avoid hard-coupling, but I haven&#8217;t had time to dig up more, so this might be my fault.<br />
- Ugliness. I&#8217;m used to a HUGE-ULTRA-CLEAN separation between classes, libraries, modules, components and applications. In the webdev world, get ready to see PHP spitting HTML with JS that spits more HTML&#8230; Or function a() that creates another function in object b, that knows about object c and changes how c behaves. Things like that. In many known js libraries.<br />
- It&#8217;s not built for team work. At Webfuel we normally don&#8217;t need to talk much with each other about development. Half a dozen guys can be working together for half a year on the same project, committing code every 5 minutes to the same SVN, without breaking the code of others. This was quite easy to achieve much thanks to the structured nature of Actionscript, on top of some very simple practices borrowed from the JAVA world. Enter Javascript and you&#8217;ll see your code breaking the code of someone else. While developing JS in a team, it&#8217;s normal that developers need to talk a lot about what each one is doing, warning the other to be careful about X or Y, or asking the other &#8220;where did you put the code for&#8230;&#8221;. Actionscript makes teamwork a joy almost since moment zero &#8211; there&#8217;s no rocket science for a healthy teamwork environment. In Javascript, the trick is to put people working in very different unrelated parts of the projects and use techniques to encapsulate their code &#8211; I have yet to learn them, but I will soon. I&#8217;ve asked some JS developers about this but the ones I know are all lone-wolves so they didn&#8217;t understand what I was talking about (apart from the reaction &#8220;SVN?? WTF?? Use GIT!&#8221;.. hum&#8230; that wasn&#8217;t my question&#8230;)<br />
- Unpredictable. In AS3, the &#8220;this&#8221; refers to the instance where the method is defined. In JS, &#8220;this&#8221; can mean pretty much anything (remember AS2?). This was one of my biggest pain-points at first. Another problem is guessing by looking at the code the properties and functions of an Object. You can&#8217;t. A function in an object can be defined pretty most anywhere. It&#8217;s up to you (and your team; and your partners; and your library-providers) to make sure that you keep your house clean with everything organized in the right place.<br />
- Code practices. These are completely different from everything you know. I taught everyone here at Webfuel to not be afraid of writing many lines of code. I want them to write self-explanatory code, like if they were writing English. Enter Javascript. And cry. By some weird reason, people like to write as much code as possible in a single line, making it not only very hard to read, but also very hard to maintain. I&#8217;ve got used to seeing the #(&#8216;huge&#8217;).line({of: code, that: function() { looks() }).like(&#8216;a&#8217;).train(); . And this practice is everywhere, pretty most all examples, libraries and worse: in books! One of the books I read had one line that took me around 5 minutes to understand! The fun part is that I had the book with me in San Francisco on the Flex Summit and I showed that line of code to several people just to scare the shit out of them. It worked!</p>
<p>Bottom line: if you&#8217;re a OOP purist, with many years of experience on software engineering on Flex and/or JAVA, you&#8217;re going to be scared. The mindset is different. The problems are different. The solutions are different. Even the slang is different. The good part: no compiling times. Which is actually a very good part&#8230;</p>
<p>There&#8217;s so many people betting in JS, shouldn&#8217;t it be good?</p>
<p>This is actually the question that confuses me the most. I simply don&#8217;t have an answer&#8230; Some people seem to be able to pretty much do anything they need. But at the same time the language certainly has its fundamental problems that can scare the shit out of you if you&#8217;re doing a one-year-project.<br />
One thing is for sure: it&#8217;s being pushed forward and you can&#8217;t deny that.</p>
<h2></h2>
<h2>CoffeeScript</h2>
<p>I haven&#8217;t tried yet CoffeeScript. After reading a bit about CoffeeScript, I&#8217;ve learnt that you still need to be comfortable with Javascript to use CoffeeScript properly. And that&#8217;s what I&#8217;m doing. On the next project I might give CS (or other language that cross-compiles) a try.</p>
<h2></h2>
<h2>Layouting and the DOM</h2>
<p>This was actually my biggest disappointment. Flex (&gt;4) is amazingly simple and powerful concerning pixel perfect skinning and layouting. You have pretty much no constraints in Flex regarding layouting, giving you immense freedom in creating perfectionist user-experiences. You don&#8217;t think &#8220;how am I going to implement this?&#8221; because there&#8217;s not much to know about Spark skinning: it&#8217;s really powerful and simple.<br />
The HTML world is different. You have to be aware of the constraints before creating the design and setting the user experience. I wasn&#8217;t aware of these constraints so we had to change the designs of the product we&#8217;re building a couple of times on the middle of the project to turn them into something possible/easier to achieve in HTML. I really hate constraints that end up affecting the user experience.</p>
<p>You have also to be prepared to accept small (and big) cross-browser rendering differences. They will happen. A lot. But that&#8217;s another topic&#8230;</p>
<h2></h2>
<h2>Optimizations/Preloading content</h2>
<p>Coming from the Flash world I was used to have to build one single application (the SWF) that has all (static) assets embedded. This results in pretty small files (yes, a SWF is smaller than it&#8217;s HTML+JS+CSS+Assets equivalent, even after minimization and gzip, and etc), only one request to the server (which results in a very low load on the server), and the assumption that all the content you need is available at runtime since moment 0. If you want to achieve a similar result in JS, you have to do it by hand &#8211; there&#8217;s nothing taking care of that for you. You have to join and minify Javascript and CSS files and resort to image sprites to reduce the number of requests to the server and the user perceived speed.</p>
<p>An image sprite is simply one PNG file with all the images and icons you use in your webapp. Then you simply apply that image as the background image of your UI component, using CSS to set a translation so it shows the icon/image you need. It&#8217;s quite simple, but make sure you load this image before your content appears on screen. The same applies to other content, in case you don&#8217;t want the user to see &#8220;glitches&#8221; on the layout while things load.</p>
<p>During loading I am hiding most divs (display: none) in the DOM, showing a preloader and after all content is ready (JS files through Lab.JS, Image Sprite, etc), I&#8217;m using jQuery to show stuff. It&#8217;s quite simple, actually, but of course, Flex did take care of all that for you&#8230; BTW, I saw this today, but I haven&#8217;t tried it yet: <a href="https://github.com/thinkpixellab/PxLoader">https://github.com/thinkpixellab/PxLoader</a></p>
<p>I&#8217;ve started today looking for a Javascript minifier. I need something that can automatically watch a folder with several JS files and merge them in a single minified file. If possible, assigning a revision number to the generated file. I haven&#8217;t yet found anything, but I&#8217;ll update this post if I have positive results.</p>
<h2></h2>
<h2>HTML(5), JS and Mobile</h2>
<p>If you think you&#8217;re going to build something in HTML(5)+JS that will work seamlessly and without problems in desktop AND mobile browsers, think again. Document based websites usually work without problems on both types of environments. But if you&#8217;re doing a more or less advanced user experience that relies in some CSS and JS magic, then be prepared to be disappointed when you open your content in your Mobile device. Not that the mobile browsers are bad &#8211; they&#8217;re actually pretty good. The problem is that the Mobile experience needs to be thought from the start &#8211; people will be using their huge clumsy fingers to interact, the screen will be smaller and the hardware resources are more limited. So at the end, you have to implement at least two different user experiences and switch between them according to the device capabilities using Media Queries. I haven&#8217;t yet tried Media Queries, so there&#8217;s not much I can say about this. I just mentioned this topic because I&#8217;ve seen several people migrating their Flash applications to HTML expecting them to work right away on iOS &#8211; without thinking that it&#8217;s probably cheaper to keep the Flash version on the desktop and building a dedicated version for iOS.</p>
<h2></h2>
<h2>UI Components</h2>
<p>DateChooser, NumericStepper, TextInput, DropDownList, RadioButton, Panels, Accordions, HGroup, Charts, Lists with Renderers, DataGrid, etc, etc, etc, almost all types of components you can imagine are available in Flex. And they are extendable and completely skinnable. You have great control in your hands. In the HTML world, either you go with the limited browser components &#8211; that are not extendable and are hard to skin but they integrate with the browser and the device -, or you have to choose a component library like jQuery UI, ExtJS or zkoss, among other &#8211; that are more or less powerful, but don&#8217;t integrate with the browser or device.</p>
<p>After exploring dozens of options, all of them with their cons and cons, I felt unsecure on choosing one option, spending time and money learning it and teaching it to my team, to later conclude that I might have chosen the wrong one. So I&#8217;ve decided <strong>NOT</strong> to try any component library &#8211; apart from the limited jQuery UI -, simply because there are too many things changing right now and it&#8217;s very hard to predict which libraries will succeed and which ones will not. I&#8217;m going to be lazy (also because I can&#8217;t study thousands of stuff at the same time) and wait to see what other Flex developers will choose. In the meantime, as I said above I won&#8217;t be using HTML(5) to build RIAs, but only simple webapps. And for that, jQuery UI is up to the task (with some quirks here and there).</p>
<h2></h2>
<h2>Crossbrowser issues</h2>
<p>Heck, this is my biggest nightmare. I tremble everytime someone says the world &#8220;web browser&#8221;. Ok, I&#8217;m exaggerating a bit. Crossbrowser issues exist, they are a PITA and they will consume <strong>at least</strong> 30% of your time in a project. But to be honest, at first I was expecting it would be a lot worse. Don&#8217;t take me wrong here, crossbrowser issues <strong>are</strong> a nightmare. Simply, they&#8217;re not as scary as I thought. If you follow me on twitter ( <a href="https://twitter.com/#!/joaosaleiro">https://twitter.com/#!/joaosaleiro</a> ) you&#8217;ve probably seen me cursing some web-browsers (hint: has two letters, starts with an I, ends with an E). Get ready to having to test something in several browsers and to change plans in the middle of the project because your approach doesn&#8217;t work as expected in one or two major browsers &#8211; especially if you&#8217;re building edge-cases and using HTML5 stuff.</p>
<p>You can&#8217;t miss this article: <a href="http://www.joelonsoftware.com/items/2008/03/17.html">http://www.joelonsoftware.com/items/2008/03/17.html</a></p>
<p>We had one crossbrowser issue this week that almost killed our current project. We needed to override the browser URL while the user was navigating the application and we couldn&#8217;t rely in simple URL hashes. We were hoping that history.pushState was up the task, but it happens that it is <strong>not</strong>. Erratic behavior in Safari, doesn&#8217;t work in IE, worked in Android until 2.3.3 and stopped working in 3.0 and 4.0 (WTF?)&#8230; Fortunately, I&#8217;ve found History.js which was built exactly to fix our problem and reduce (not fix) the cross-browser issues. See, the good thing is that crossbrowser issues happen to everyone, so you&#8217;ll likely find a workaround on the web.</p>
<p>If you&#8217;re doing HTML5 you probably know about <a href="http://caniuse.com/">http://caniuse.com/</a> . If you don&#8217;t, go there.</p>
<h2></h2>
<h2>Productivity</h2>
<p>Our productivity is pretty bad right now &#8211; but we are getting better! We&#8217;ve spent 11 weeks of two resources to build something in HTML(5)+JS that we would have built in 3 weeks with the same resources in Flex, without any stress at all. Of course, I take a big part of the guilt here: we&#8217;re still learning and during the first weeks there were a lot of readings, plan changes, tests and bumps on the road.<br />
The real issue is how tight the relation between productivity and your experience with the tech is: the bumps on the road are there, they happen to everyone and you won&#8217;t be able to predict them, so the only solution is be experienced and be aware of those issues. They will simply happen, you&#8217;ll curse them, search the internet for hours, fix/hack them and the next time you&#8217;ll meet them, THEN, you&#8217;ll be ready and productive.<br />
You&#8217;ll end up implementing workarounds and hacks (on top of other hacks) constantly. Coming from the Flex world, you&#8217;ll feel ashamed of your hack &#8211; don&#8217;t be. It&#8217;s normal. Most of the times, you won&#8217;t have another choice but to accept the hack and move on.<br />
Coming from a rapid development environment as Flex, productivity in JS and HTML can be quite frustrating until you get used to the bumps on the road. After you&#8217;re experienced, it will get better, but I don&#8217;t expect it to come any close to Flex development in a near future.</p>
<h2></h2>
<h2>Conclusions</h2>
<p>The first conclusion is that we&#8217;ll keep using Flex in long-term enterprise RIAs projects. Neither the open-standards nor us are ready to build the same type of experiences that our clients expect us to.</p>
<p>At the same time, we&#8217;ll be accepting smaller webapps. At this point, after three months, we&#8217;re already pretty comfortable building web experiences, so it&#8217;s a matter of raising the bar slowly, webapp after webapp. But I don&#8217;t think we&#8217;ll be able to do the same type of RIAs we were doing with Flex at least not in the next two years. Also, maintainability and its cost scare the shit out of me. And all the moving parts of HTML5 &#8211; new libraries appearing, others disappearing, browsers dropping support of features, etc. There are lots of &#8220;ands&#8221;.</p>
<p>I know I&#8217;ve missed half a dozen topics above and I know I&#8217;ll have dozens of other to write about in a couple of months. Actually, there are no real conclusions here &#8211; only open subjects. There&#8217;s much to be investigated and learned. I&#8217;m sure I&#8217;m not completely right in some of the above topics and I would love to get your feedback, pointing me in the right directions where I got it wrong. I can only hope that most of the stuff I pointed above won&#8217;t look as bad in a couple of months as it looks now. Or that browser vendors shake hands and decide to stop fragmenting the web. Maybe they could all be friends and adopt the same rendering engine and VM (_giggles_). For example, Google Dart. (_yeah, right_&#8230;)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Original post: <a href="https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs">https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs</a> (please try to keep comments on the original post, of possible)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2012/01/13/depois-de-6-anos-de-flex-irei-migrar-para-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe doa o Flex SDK à Apache Foundation &#8211; ponto de situação</title>
		<link>http://www.riapt.org/2012/01/05/adobe-doa-o-flex-sdk-a-apache-foundation-ponto-de-situacao/</link>
		<comments>http://www.riapt.org/2012/01/05/adobe-doa-o-flex-sdk-a-apache-foundation-ponto-de-situacao/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:53:24 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=965</guid>
		<description><![CDATA[A Adobe anunciou a doação do Flex SDK à Apache Foundation em Novembro de 2011. Em Dezembro, a Adobe promoveu um evento em São Francisco &#8211; Flex Summit &#8211; com o objectivo de elucidar a comunidade e obter feedback em relação à doação. Os vídeos do evento estão disponíveis na AdobeTV e estão repletos de informação útil (e [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://blogs.adobe.com/flex/2011/12/an-update-on-flex.html">Adobe anunciou a doação do Flex SDK à Apache Foundation</a> em Novembro de 2011. Em Dezembro, a Adobe promoveu um evento em São Francisco &#8211; Flex Summit &#8211; com o objectivo de elucidar a comunidade e obter feedback em relação à doação. Os vídeos do evento estão disponíveis na <a href="http://tv.adobe.com/show/flex-community-summit-december-2011/">AdobeTV</a> e estão repletos de informação útil (e se olharem com atenção podem encontrar-me a <a href="https://twitter.com/#!/joaosaleiro">mim </a>e ao <a href="https://twitter.com/#!/joaofernandes">João Fernandes</a> sentados na assistência ou a dizer parvoíces <img src='http://www.riapt.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>No dia 31 de Dezembro, o Flex foi finalmente <a href="http://blogs.adobe.com/flex/2011/12/a-great-ending-to-2011.html">aceite pela Apache Foundation</a> e está agora em processo de incubação (um género de &#8220;processo de passagem da Adobe para o Apache&#8221;).</p>
<p>As Mailing Lists oficiais do Apache Flex foram criadas no dia 3 de Janeiro e entretanto já foram trocados 349 emails (em 2 ou 3 dias!) &#8211; o que demonstra o elevado interesse da comunidade, com um nível de participação muito acima do esperado. Os arquivos da mailing list estão disponíveis aqui: <a href="http://mail-archives.apache.org/mod_mbox/incubator-flex-dev/">http://mail-archives.apache.org/mod_mbox/incubator-flex-dev/</a></p>
<p>Para se inscreverem na mailing list do Apache Flex podem fazê-lo com as instruções disponíveis em <a href="http://incubator.apache.org/flex/mailing-lists.html">http://incubator.apache.org/flex/mailing-lists.html</a></p>
<p>As discussões  têm sido extremamente interessantes, mas quem não tiver paciência para ler os 349 emails pode sempre visitar este URL para ver um resumo dos tópicos discutidos: <a href="http://blog.teotigraphix.com/2012/01/05/apache-flex-flex-dev-summaries/">http://blog.teotigraphix.com/2012/01/05/apache-flex-flex-dev-summaries/</a> .</p>
<p>Uma página temporária para o Apache Flex foi criada aqui: <a href="http://incubator.apache.org/flex/">http://incubator.apache.org/flex/</a> . Ainda não tem muita informação, mas irá evoluir ao longo do tempo.</p>
<p>O SVN do Flex SDK está a ser migrado da Adobe para a Apache, tal como o JIRA. Este é um processo que deverá demorar entre uma a duas semanas (digo/espero eu).</p>
<p>Continua em aberto a minha sugestão de se realizar um evento de Q&amp;A para vos elucidar (ou às vossas empresas/&#8221;chefes&#8221;) em quaisquer questões que tenham, mas como há a possibilidade da (antiga) Flex Team vir a Portugal, esta sugestão fica <em>on hold</em> durante mais alguns dias.</p>
<p>Entretanto podem enviar questões que tenham relativas ao processo de transição e ao futuro do Flex para a <a href="http://groups.google.com/group/riapt">Mailing List do riapt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2012/01/05/adobe-doa-o-flex-sdk-a-apache-foundation-ponto-de-situacao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gerir projectos no Eclipse, Flash Builder, Zend, Aptana, etc</title>
		<link>http://www.riapt.org/2011/08/03/gerir-projectos-no-eclipse-flash-builder-zend-aptana-etc/</link>
		<comments>http://www.riapt.org/2011/08/03/gerir-projectos-no-eclipse-flash-builder-zend-aptana-etc/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 15:08:50 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIAPT]]></category>
		<category><![CDATA[Rich UI]]></category>
		<category><![CDATA[SCRUM]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=924</guid>
		<description><![CDATA[A versão 1.5 do Airgile &#8211; uma plataforma online de gestão de equipas e projectos -, lançada esta semana, suporta agora a interligação com IDEs baseados em Eclipse, como o Flash Builder, Zend ou Aptana, entre outros. Este conector permite que gestores de projecto e equipas de desenvolvimento possam colaborar de uma forma mais eficaz. [...]]]></description>
			<content:encoded><![CDATA[<p>A versão 1.5 do <a href="http://airgile.com" target="_blank">Airgile</a> &#8211; uma plataforma online de gestão de equipas e projectos -, lançada esta semana, suporta agora a interligação com IDEs baseados em <a href="http://www.eclipse.org"  target="_blank">Eclipse</a>, como o <a href="http://www.adobe.com/products/flash-builder.html"  target="_blank">Flash Builder</a>, <a href="http://www.zend.com/products/studio/"  target="_blank">Zend</a> ou <a href="http://www.aptana.com/"  target="_blank">Aptana</a>, entre outros. Este <a href="http://www.airgile.com/welcome/pt/conector-eclipse"  target="_blank">conector</a> permite que gestores de projecto e equipas de desenvolvimento possam colaborar de uma forma mais eficaz.</p>
<p>O gestor de projecto irá usufruir do conforto do <a href="http://airgile.com" target="_blank">Airgile</a> para gerir e acompanhar a evolução dos projectos, delegando tarefas aos consultores e programadores. Estes receberão as tarefas directamente no Eclipse, a sua ferramenta de trabalho de eleição. À medida que completam as tarefas, os consultores podem fechá-las directamente no Eclipse, que irá sincronizar com o Airgile (automaticamente), actualizando os indicadores e notificando o gestor de projecto.</p>
<p>Este é o workflow de gestão que usamos na <a href="http://www.webfuel.pt" target="_blank">Webfuel</a>, ligando o Eclipse antigamente ao Trac e actualmente com o Airgile &#8211; que é mais rápido e confortável. É relativamente fácil configurar a ligação, estando as instruções disponíveis <a href="http://www.airgile.com/welcome/pt/conector-eclipse">aqui</a>.<br/><br/>No vídeo abaixo, a partir dos 5:45 é possível ver o conector em acção.<br />
<br/><br />
<center><br />
<iframe class="aligncenter" width="560" height="349" src="http://www.youtube.com/embed/5meCMry5ank" frameborder="0" allowfullscreen></iframe><br />
</center><br />
<br/><br/><br />
Esta versão do Airgile, entre dezenas de novidades, possui agora um novo interface gráfico, ainda mais leve e intuitivo.<br />
Desde a versão 1 foram adicionadas muitas novas funcionalidades ao Airgile, como a filtragem avançada, registo de actividade, ferramentas de planificação, criação/edição rápida de tarefas, e faseamento de projectos, entre outras. As próximas versões contarão com planeamento de Sprints e um Burndown-chart para projectos baseados em SCRUM.<br />
<br/><br />
<img class="aligncenter" width="600" src="http://www.airgile.com/welcome/images/tour/gui_pt.png" alt="Tarefas partilhadas entre o Airgile e o Eclipse" /><br />
<br/><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/08/03/gerir-projectos-no-eclipse-flash-builder-zend-aptana-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Primeiro Evento da Comunidade HTML5 PT (dia 07/07)</title>
		<link>http://www.riapt.org/2011/07/06/primeiro-evento-da-comunidade-html5-pt-dia-0707/</link>
		<comments>http://www.riapt.org/2011/07/06/primeiro-evento-da-comunidade-html5-pt-dia-0707/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 12:04:19 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=915</guid>
		<description><![CDATA[Decorre no dia 7 de Julho pelas 19h no auditório da Microsoft do Tagus Park o primeiro evento da comunidade HTML5PT O evento contará com as seguintes sessões: Aplicações Offline Descrição: A capacidade de aplicações web poderem ser corridas offline é uma das principais funcionalidades disponíveis na nova especificação HTML5. Esta apresentação foca-se em como [...]]]></description>
			<content:encoded><![CDATA[<p>Decorre no dia 7 de Julho pelas 19h no auditório da Microsoft do Tagus Park o primeiro evento da comunidade HTML5PT</p>
<p>O evento contará com as seguintes sessões:</p>
<p><strong>Aplicações Offline</strong></p>
<p><em>Descrição</em>: A capacidade de aplicações web poderem ser corridas offline é uma das principais funcionalidades disponíveis na nova especificação HTML5. Esta apresentação foca-se em como fazer uma aplicação offline usando: application cache, local storage e webSQL (agora deprecated). Ao longo da apresentação será construída uma aplicação móvel que pode correr em múltiplos ambientes.</p>
<p><em>Bio do Orador</em>: Vasco Andrade e Silva é CEO na Byclosure, uma startup portuguesa que trabalha no desenvolvimento de aplicações HTML5 sobre diferentes plataformas e dispositivos. Detém um mestrado em Engenharia Informática e de Computadores pelo Instituto Superior Técnico de Lisboa. Na área de gestão de projectos ageis detém os certificados de Certified Scrum Master e Certified Product Owner. Trabalha de perto com tecnologias web como o GWT e Ruby On Rails e sobre diferentes diferentes dispositivos iPhone, iPad, Android, PC. Para além do acompanhamento de todo o lifecicle da venda, desenvolvimento e manutenção de aplicações web tem especial interesse na automação de testes unitários e de aceitação. Fora do trabalho gosta de jogar Basket e foi treinador de equipas sub-16 e sub-18 em diferentes clubes.</p>
<p><strong>Novas APi’s no HTML5</strong></p>
<p><em>Descrição</em>: A nova versão do HTML5 introduz um conjunto de novas API’s que até agora estavam apenas disponíveis através de plugins. Nesta sessão será feita uma introdução e veremos demonstrações  das API’s  WebSockets, File e Media capture conforme a especificação do W3C.</p>
<p><em>Bio do Orador</em>: Tiago Andrade e Silva é Developer Evangelist na Microsoft. Nos últimos 14 anos tem focado a sua actividade profissional na área do desenvolvimento de soluções Web. Esteve em empresas como Fullsix, Tinta Invisível, Neoris e Oni. Detém um mestrado em Engenharia Informática pela Universidade Nova de Lisboa e tem-se especializado na área de gestão de projectos, com foco nos métodos Ágeis. É Project Management Professional (PMP), Certified Scrum Professional, Certified Scrum Master, Certified Product Owner e foi o fundador da Comunidade Portuguesa de Scrum.</p>
<p><strong>Local do Evento</strong></p>
<p>Edifício Qualidade, C1 – C2<br />
Av. Prof. Doutor Aníbal Cavaco Silva<br />
Tagus Park<br />
2744-010 Porto Salvo</p>
<p>Mais informações sobre o evento podem ser vistas aqui: <a href="http://html5pt.org/">http://html5pt.org/</a></p>
<p>As inscrições estão abertas em <a href="http://html5pt.eventbrite.com/">http://html5pt.eventbrite.com/</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/07/06/primeiro-evento-da-comunidade-html5-pt-dia-0707/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile Portugal 2011 a 20-22 de Junho, no Porto</title>
		<link>http://www.riapt.org/2011/05/29/agile-portugal-2011-a-20-22-de-junho-no-porto/</link>
		<comments>http://www.riapt.org/2011/05/29/agile-portugal-2011-a-20-22-de-junho-no-porto/#comments</comments>
		<pubDate>Sun, 29 May 2011 22:16:06 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Eventos]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=905</guid>
		<description><![CDATA[Para os amantes das metodologias ágeis de gestão de projectos, recomendo vivamente o evento Agile Portugal 2011. A segunda edição da Agile Portugal terá lugar em 20-22 Junho, no Porto, novamente perto do S.João, a maior festa da cidade. O objectivo da conferência mantém-se o mesmo, promover um ambiente de inovação, discussão, e networking com [...]]]></description>
			<content:encoded><![CDATA[<p>Para os amantes das metodologias ágeis de gestão de projectos, recomendo vivamente o evento Agile Portugal 2011.</p>
<p>A segunda edição da Agile Portugal <http: 2011.agilept.org=""> terá lugar em 20-22 Junho, no Porto, novamente perto do S.João, a maior festa da cidade. O objectivo da conferência mantém-se o mesmo, promover um ambiente de inovação, discussão, e networking com outros agilistas nacionais e internacionais, juntando sob o mesmo tecto liders, praticantes e formadores.</http:></p>
<p>Um evento a não perder! Existe um número limitado de lugares, por isso não é de deixar o registo para os últimos momentos. </p>
<p>O Programa deste ano conta já com um conjunto muito bom de palestrantes de renome internacional, como:</p>
<ul>
<li>Allen Wirfs-Brock</li>
<li>Dave Thomas</li>
<li>Joseph Yoder</li>
<li>Mike Beedle</li>
<li>Mitch Lacey</li>
<li>Rebecca Wirfs-Brock</li>
</ul>
<p>No website da conferência é possível encontrar as últimas notícias e actualizações ao programa. Visite o website do evento &#8211; <a href="http://2011.agilept.org/" _mce_href="http://2011.agilept.org/">http://2011.agilept.org/</a>&nbsp;-&nbsp;para mais informações.</p>
<p>Aproveito ainda para informar que, numa parceria entre a Webfuel e a Agile Portugal 2011, temos um código promocional de 20€ para o <a href="http://airgile.com">Airgile</a>, uma plataforma de gestão de projectos. O código é válido até dia 23 de Junho de 2011, e para o utilizar basta preencher &#8220;agilept2011&#8243; no campo &#8220;código promocional&#8221; durante o registo no Airgile.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/05/29/agile-portugal-2011-a-20-22-de-junho-no-porto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Palestra online sobre Flex Mobile</title>
		<link>http://www.riapt.org/2011/05/17/palestra-online-sobre-flex-mobile/</link>
		<comments>http://www.riapt.org/2011/05/17/palestra-online-sobre-flex-mobile/#comments</comments>
		<pubDate>Tue, 17 May 2011 09:22:25 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Eventos]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=901</guid>
		<description><![CDATA[No próximo Sábado, dia 21 de Maio, pelas 18:00 no horário local de Lisboa &#8211; Portugal, 14:00 horário oficial brasileiro, decorrerá uma palestra online sobre a utilização de Adobe Flex no desenvolvimento de projetos para Smartphones. O orador será o Igor Costa, CEO da RIACycle. &#8220;Com 6 anos de experiência com Flex, Igor se tornou [...]]]></description>
			<content:encoded><![CDATA[<p>No próximo Sábado, dia 21 de Maio, pelas 18:00 no horário local de Lisboa &#8211; Portugal, 14:00 horário oficial brasileiro, decorrerá uma palestra online sobre a utilização de Adobe Flex no desenvolvimento de projetos para Smartphones.</p>
<p>O orador será o Igor Costa, CEO da RIACycle.</p>
<p>    &#8220;Com 6 anos de experiência com Flex, Igor se tornou conhecido na comunidade Flex por evangelizar o produto para empresas e faculdades espalhadas pelo Brasil. Sendo o primeiro instrutor de Flex no Brasil. Sente-se feliz de ter formado mais de 900 pessoas quando trabalhava na ENG DTP. Já palestrou em vários eventos nacionais como o Just Java, internacionais como o OSFlash Conference, e também cria eventos como o Flex Mania. Traz consigo uma experiência de 11 anos de desenvolvimento de software e compartilha com todos os mesmo sonho que informação precisa ser barata e rápida. Dedica-se a criar, compartilhar e explorar os valores de cada solução RIA para seus alunos.&#8221;</p>
<p>No final da palestra será sorteada uma bolsa de estudos no valor integral do curso de Flex Mobile da RIACycle. O curso é transmitido via Internet, assim, caso o vencedor resida na Europa poderá participar no curso.</p>
<p>URL para detalhes sobre o evento: <a href="http://flexduck.groups.adobe.com/index.cfm?event=post.display&#038;postid=36363">http://flexduck.groups.adobe.com/index.cfm?event=post.display&#038;postid=36363</a></p>
<p>URL para acesso a palestra: <a href="http://experts.adobeconnect.com/flexduck-flexsmartphones/">http://experts.adobeconnect.com/flexduck-flexsmartphones/</a></p>
<p>URL para conhecer a bolsa oferecida: <a href="http://riacycle.com/flexmobile/">http://riacycle.com/flexmobile/</a></p>
<p>(Conteúdos fornecidos pelo Stefan Horochovec)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/05/17/palestra-online-sobre-flex-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4.5 &#8211; Produtividade e Desenvolvimento para Mobile</title>
		<link>http://www.riapt.org/2011/05/09/flash-builder-4-5-produtividade-e-desenvolvimento-para-mobile/</link>
		<comments>http://www.riapt.org/2011/05/09/flash-builder-4-5-produtividade-e-desenvolvimento-para-mobile/#comments</comments>
		<pubDate>Mon, 09 May 2011 10:19:20 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Adobe Air]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Rich UI]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=884</guid>
		<description><![CDATA[Foi lançado esta semana o Flash Builder 4.5 cujas novidades assentam no desenvolvimento para Smartphones e Tablets e nas ferramentas de aumento de produtividade. O aumento de produtividade no Flash Builder destaca-se através de várias pequenas mas extremamente úteis funcionalidades para simplificar a vida do programador enquanto escreve código, tais como: Code templates &#8211; o [...]]]></description>
			<content:encoded><![CDATA[<p>Foi lançado esta semana o Flash Builder 4.5 cujas novidades assentam no desenvolvimento para Smartphones e Tablets e nas ferramentas de aumento de produtividade.</p>
<p>O aumento de produtividade no Flash Builder destaca-se através de várias pequenas mas extremamente úteis funcionalidades para simplificar a vida do programador enquanto escreve código, tais como:</p>
<p><strong>Code templates</strong> &#8211; o Flash Builder traz cerca de uma centena de code templates, mas estes são configuráveis pelo programadorsendo fácil adicionar novos. Para activar um code template, basta, por exemplo, escrever &#8220;fori&#8221;, carregar CTRL+Space, e o Flash Builder escreverá automaticamente &#8220;for (var i:Number = 0 &#8230;. etc&#8221;.</p>
<p><strong>Code completion para Metadata</strong> &#8211; basta escrever [B (Ctrl+Space) e o FB preenche o resto <img src='http://www.riapt.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Live error Highlighting</strong> - ao escrever código o Flash Builder agora aponta os erros sem ser necessário compilar. De notar que isto funciona com grande parte dos erros, mas não com todos.</p>
<p><strong>Melhorias no IDE</strong> - a performance do IDE foi melhorada, tal como a velocidade de compilação. O design mode agora consegue fazer o rendering de views mais complexas</p>
<p><strong>Quick-assist </strong>- na realidade esta não é uma, mas sim dezenas de funcionalidades. O Quick-assist é um atalho (CTRL+1) que quando é chamado abre um menu com várias opções, de acordo com o contexto, como por exemplo:</p>
<ul>
<li>Geração de event handlers</li>
<li>Organização dos imports</li>
<li>Criação de métodos automática</li>
<li>Declaração de variáveis</li>
<li>Promoção de variáveis locais para propriedades da classe</li>
<li>[... outras ...]</li>
</ul>
<p>Neste vídeo do Serge, é possível ver algumas destas funcionalidades em acção:</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/HzUZl_M7vBQ?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HzUZl_M7vBQ?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Relativamente ao desenvolvimento para <strong>dispositivos móveis</strong>, o Flash Builder é agora um ambiente extremamente confortável para desenvolver para smartphones e tablets Android, iOS e BlackBerry (Playbook).</p>
<p>A versão que foi disponibilizada ainda só exporta aplicações para Android, mas muito em breve será lançado um update que permite exportar a mesma aplicação com o mesmo código para iOS.</p>
<p>O Flex SDK possui agora um conjunto de componentes &#8220;light&#8221; especialmente optimizados para telemóveis e ainda uma framework que simplifica o desenvolvimento  ao gerir pelo programador a navegação entre as views, a &#8220;cache&#8221; dos dados em cada view, etc. No desenvolvimento para Mobile é importante ter em conta as diferentes resoluções e densidades de cada smartphone &#8211; o Flash Builder possui ferramentas para gerir confortavelmente o desenvolvimento para diferentes ecrãs (multi-screen development).</p>
<p>Neste vídeo do Serge podemos ver mais sobre o desenvolvimento para Mobile:</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/LqlR-bHc3XI?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/LqlR-bHc3XI?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Este é também um vídeo interessante que mostra os Charting components a correr no iPad, iPhone, Android e BlackBerry Playbook:</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/paTRLcmErNY?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/paTRLcmErNY?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Para quem pretende explorar mais o desenvolvimento para Mobile usando Adobe Air, deixo aqui este recurso (embora não seja completamente orientado ao Flex):</p>
<p>&nbsp;</p>
<p><img class="aligncenter" src="http://covers.oreilly.com/images/0636920013884/cat.gif" alt="Book cover of Developing Android Applications with Adobe AIR" /></p>
<p>&nbsp;</p>
<p>Esta é, na minha opinião, a melhor release do Flash Builder até à data. Ou pelo menos, é a mais sólida e que eleva o desenvolvimento em Flex para outro patamar, muito próximo da experiência de desenvolvimento típica no mundo JAVA.</p>
<p>Eu, o Rui Silva e o João Fernandes acompanhamos esta release desde o início e tivemos a oportunidade de contribuir para a evolução da mesma. Orgulhosamente temos agora dois nomes portugueses nos créditos do Flash Builder, se bem que o João Fernandes também merecia. E não queria deixar de mandar um abraço para o Carlos Rovira ali na vizinha Espanha. <img src='http://www.riapt.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p><a href="http://www.riapt.org/wp-content/uploads/2011/05/credits.jpg"><img class="aligncenter size-full wp-image-887" title="credits" src="http://www.riapt.org/wp-content/uploads/2011/05/credits.jpg" alt="" width="640" height="479" /></a></p>
<p>&nbsp;</p>
<p>Não se esqueçam que podem sempre utilizar a <a href="http://groups.google.com/group/riapt" target="_blank">Mailing List</a> para partilhar as vossas experiências ou colocar questões ao resto da comunidade.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/05/09/flash-builder-4-5-produtividade-e-desenvolvimento-para-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Airgile &#8211; Gestão de projectos em Português</title>
		<link>http://www.riapt.org/2011/04/11/airgile-uma-ria-de-gestao-de-projectos-em-tempo-real/</link>
		<comments>http://www.riapt.org/2011/04/11/airgile-uma-ria-de-gestao-de-projectos-em-tempo-real/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 13:05:37 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Exemplos]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIAPT]]></category>
		<category><![CDATA[Rich UI]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=851</guid>
		<description><![CDATA[O Airgile é uma Rich Internet Application de gestão de equipas, projectos e tarefas implementada pela Webfuel caracterizada pelo seu interface absolutamente delicioso e pela sua simplicidade e velocidade de resposta, sendo possívelmente a mais rápida aplicação do género no mercado. O Airgile sincroniza automaticamente as alterações às tarefas entre todos os elementos da equipa automaticamente, [...]]]></description>
			<content:encoded><![CDATA[<p>O <a href="http://airgile.com" target="_blank">Airgile</a> é uma Rich Internet Application de gestão de equipas, projectos e tarefas implementada pela <a href="http://www.webfuel.pt" target="_blank">Webfuel</a> caracterizada pelo seu interface absolutamente delicioso e pela sua <strong>simplicidade </strong>e velocidade de resposta, sendo possívelmente a mais rápida aplicação do género no mercado.</p>
<p>O Airgile <strong>sincroniza </strong>automaticamente as alterações às tarefas entre todos os elementos da equipa automaticamente, o que permite que as equipas trabalhem a todo o gás e que os gestores de projecto acompanhem as evoluções ao projecto em tempo real através de um <strong>dashboard </strong>intuitivo. Pesquisas e filtragens a milhares de tarefas demoram menos de meio segundo, tal como adicionar ou editar tarefas &#8211; através do Quick-Add e Quick-edit.</p>
<p style="text-align: center;"><a href="http://www.riapt.org/wp-content/uploads/2011/04/1-dashboard1.jpg" target="_blank"><img class="aligncenter size-large wp-image-869" title="1-dashboard" src="http://www.riapt.org/wp-content/uploads/2011/04/1-dashboard1-1024x575.jpg" alt="" width="600" height="337" /></a></p>
<p>Feito a pensar em equipas espalhadas em redor do mundo, suporta <strong>multi-linguagem</strong> (por agora em Português e Inglês) e lida automaticamente com o fuso horário. Isto é,  uma tarefa introduzida a uma determinada hora em Portugal, aparece com a hora correcta para os elementos da equipa localizados no Brasil sem qualquer configuração necessária.</p>
<p>Além da informação detalhada que é possível colocar numa tarefa &#8211; como o tipo, estado, importância, data de início, fim, orçamento, entre outras -, é ainda possível anexar<strong> múltiplos ficheiros</strong> de uma só vez sem que tenha que esperar que o envio termine para continuar a trabalhar. Isto é, a aplicação não bloqueia em tarefas assíncronas, tudo com o objectivo de aumentar a produtividade! O sistema de <em>preview inline </em>permite visualizar imagens e ficheiros de texto dentro da aplicação, sem ter que os descarregar para o seu computador.</p>
<p style="text-align: center;"><a href="http://www.riapt.org/wp-content/uploads/2011/04/4-detail.jpg" target="_blank"><img class="aligncenter size-large wp-image-857" title="4-detail" src="http://www.riapt.org/wp-content/uploads/2011/04/4-detail-1024x575.jpg" alt="" width="600" height="337" /></a></p>
<p>O sistema de <strong>comentários</strong> associado a cada tarefa reforça a comunicação entre os elementos da equipa &#8211; ou mesmo com o cliente -, incentivando a troca de ideias ou pedidos de esclarecimento.</p>
<p>O Airgile encarrega-se de enviar automaticamente <strong>emails </strong>a todos os utilizadores ligados a um projecto sempre que há alterações  (nova tarefa, tarefa editada, novo comentário, etc), podendo o gestor de conta activar a opção de <strong>subscrição </strong>por tarefa, permitindo que cada pessoa opte individualmente por receber mails só nas alterações das tarefas que escolher.</p>
<p>O sistema de permissões permite ligar utilizadores a projectos, sendo definido projecto a projecto se determinado utilizador pode somente consultar, inserir tarefas, e deixar comentários; se pode aceder às tarefas <strong>confidenciais;</strong> ou ainda se terá permissões de gestor de projectos que lhe permitem manipular todas as tarefas.</p>
<p style="text-align: center;"><img class="aligncenter" title="2-list" src="http://www.riapt.org/wp-content/uploads/2011/04/2-list-1024x575.jpg" alt="" width="600" /></p>
<p>Como cada projecto e negócio é diferente, o Airgile permite-lhe <strong>configurar </strong>projecto a projecto os tipos, estados e níveis de importância das tarefas. Isto é, é fácil adaptar os projectos a áreas completamente distintas, como a consultoria em IT, ou a advocacia.</p>
<p>Os pormenores de usabilidade do Airgile são deliciosos, com vista não só a aumentar largamente a produtividade da equipa e assegurar o cumprimento de prazos, como também a permitir a utilização por diferentes pessoas com níveis de conhecimentos informáticos completamente díspares: a sua simplicidade tornam o Airgile na ferramenta de gestão de projectos ideal tanto para utilizadores experientes, como para utilizadores inexperientes.<a href="http://www.riapt.org/wp-content/uploads/2011/04/2-list.jpg"></a></p>
<p>Estando alojado numa Cloud, a plataforma está acessível a partir de qualquer computador em qualquer local do mundo com ligação à Internet, sendo compatível com todos os sistemas operativos e web-browsers usando o Flash Player 10.2. Não existem incompatibilidades entre web-browsers e sistemas operativos, sendo o desempenho e robustez da aplicação sempre ao mais alto nível.</p>
<p style="text-align: center;"><a href="http://www.riapt.org/wp-content/uploads/2011/04/3-new.jpg" target="_blank"><img class="aligncenter size-large wp-image-856" title="3-new" src="http://www.riapt.org/wp-content/uploads/2011/04/3-new-1024x575.jpg" alt="" width="600" /></a></p>
<p>O Airgile está disponível no modelo Software-as-a-service, isto é, mediante o pagamento de uma mensalidade muito baixa (a começar nos 6€/mês!), mas possui também uma conta gratuíta limitada a um projecto. Ao longo do tempo, o Airgile continuará a crescer com novas funcionalidades sempre com vista a aumentar a produtividade dos utilizadores.</p>
<p>O site do Airgile está disponível em <a href="http://airgile.com" target="_blank">http://airgile.com</a> e possui não só vários vídeos de demonstração, como lhe permite testar uma conta de demonstração com dados fictícios antes de poder criar a sua conta.</p>
<p style="text-align: center;"><a href="http://www.riapt.org/wp-content/uploads/2011/04/5-comments.jpg" target="_blank"><img class="aligncenter size-large wp-image-858" title="5-comments" src="http://www.riapt.org/wp-content/uploads/2011/04/5-comments-1024x575.jpg" alt="" width="600" /></a></p>
<p>A aplicação foi desenvolvida pela <a href="http://www.webfuel.pt" target="_blank">Webfuel</a>, sendo completamente nacional. Assenta na Cloud, e corre em qualquer browser, tendo sido implementada em Flex usando o Adobe Flash Builder 4.5.  Planeamos lançar uma versão instalável com suporte a OCC (trabalhar offline) e uma versão para Android e iOS através de Air 2.6.</p>
<p>Experimentem o <a href="http://www.airgile.com" target="_blank">Airgile</a>, forneçam-nos feedback usando o <a href="http://airgile.com/welcome/pt/forum" target="_blank">fórum</a> e ajudem-nos a divulgar este produto de origem nacional! <img src='http://www.riapt.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div><span style="color: #0000ee;"><br />
</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/04/11/airgile-uma-ria-de-gestao-de-projectos-em-tempo-real/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porquê aprender Maven?</title>
		<link>http://www.riapt.org/2011/01/04/porque-aprender-maven/</link>
		<comments>http://www.riapt.org/2011/01/04/porque-aprender-maven/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 19:56:21 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Introduções]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=815</guid>
		<description><![CDATA[Prólogo Comecei recentemente a dar os primeiros passos na aprendizagem de Maven, e apesar de ainda ser um novato achei por bem partilhar as razões pelas quais esta tecnologia é tão interessante. Apesar de utilizarmos Maven há já algum tempo nos nossos projectos na Webfuel e de conhecer os seus benefícios, nunca tinha investido tempo [...]]]></description>
			<content:encoded><![CDATA[<h2>Prólogo</h2>
<p>Comecei recentemente a dar os primeiros passos na aprendizagem de <a href="http://en.wikipedia.org/wiki/Apache_Maven">Maven</a>, e apesar de ainda ser um novato achei por bem partilhar as razões pelas quais esta tecnologia é tão interessante.</p>
<p>Apesar de utilizarmos Maven há já algum tempo nos nossos projectos na <a href="http://www.webfuel.pt">Webfuel </a>e de conhecer os seus benefícios, nunca tinha investido tempo na sua aprendizagem visto que a configuração dos projectos com Maven estava a cargo de uma empresa nossa parceira (<a href="http://www.web-responsive.com">Web-Responsive</a>). Sou, portanto, tenrinho no assunto, mas sinto-me compelido a partilhar as razões pelas quais vale a pena aprender Maven.</p>
<p>Este post não é um tutorial a explicar como se usa, mas sim uma descrição de alguns dos problemas (use cases) que o Maven resolve em projectos complexos. De notar ainda que o Maven não é específico ao desenvolvimento de RIAs, mas sim aplicável ao desenvolvimento em qualquer tecnologia que tenha um plugin para Maven. Para Flex existe o <a href="http://code.google.com/p/flex-mojos/">flex-mojos</a> que cobre grande parte dos tópicos referidos neste post, mas não todos (ainda). Diria que no mundo J2EE, aí sim, o Maven se porta brilhantemente &#8211; por exemplo, na configuração de um JAVA + <a href="http://www.springsource.org/">Spring </a>+ <a href="http://www.hibernate.org/">Hibernate </a>+ <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS">BlazeDS </a>+ <a href="http://www.springsource.org/spring-flex">Springflex </a>+ montes.de.outras.libs.</p>
<h2>O que é o Maven?</h2>
<p>O Maven é uma ferramenta poderosa para gestão de projectos, gestão de dependências, gestão de versões, automatização do processo de build (compilação, unit tests, reporting, etc), configuração de ambientes de desenvolvimento, entre outras. É uma ferramenta com cerca de 3 megas que se utiliza através da linha de comandos (ou através de alguns plugins para Eclipse, como o m2eclipse), para executar diversas tarefas sobre um (ou vários) projecto(s), regra geral associadas à sua compilação, mas sobretudo manutenção. Bem, o ideal é mesmo ver os exemplos mais abaixo&#8230;</p>
<h2>(Mais prólogo) Esqueçamos o modelo de projectos gigantes&#8230;</h2>
<p>É importante compreender que existe uma maneira &#8220;à-la-Maven&#8221; para a estruturação de um projecto. Um &#8220;projecto físico&#8221; deve ser separado em vários sub-projectos/componentes/bibliotecas (artefactos), com dependências entre eles. A noção de um projecto, com Maven, pode resultar em 10 ou mesmo 100 &#8220;projectos Eclipse&#8221;.  Por outras palavras, o projecto &#8220;my-huge-crm-application&#8221; quando criado &#8220;à-la-Maven&#8221; deve ser dividido em &#8220;my-crm-users&#8221;, &#8220;my-crm-reports&#8221;, &#8220;my-crm-costumers&#8221;, &#8220;my-crm-commons&#8221;, &#8220;my-crm-config&#8221;, &#8220;my-company-lib&#8221;, &#8220;my-3rdparty-lib&#8221;, etc &#8211; podendo-se atingir com facilidade 10 ou 20 projectos diferentes, com dependências uns dos outros (isto é, o my-crm-commons.jar é usado pelo my-crm-costumers, etc).</p>
<p>À primeira vista, pode parecer mais confuso, mas na realidade resulta numa maior simplicidade &#8211; graças à elegância do Maven, como veremos adiante.</p>
<p>O Maven lida com uma simplicidade extrema com as dependências entre projectos e com o processo de build &#8211; por exemplo, ao compilar um projecto que depende de outro, o Maven irá descarregar o outro projecto de um repositório onde possa estar instalado, ou se não o encontrar, mas tiver &#8220;acesso&#8221; ao código fonte, compilar o outro projecto -, e graças a esta arquitectura de gestão de dependências, torna-se relativamente fácil acoplar, desacoplar e substituir projectos/módulos/dependências num projecto.</p>
<h2>(Ainda mais prólogo) Algumas notas prévias</h2>
<div id="_mcePaste">
<ol>
<li> Para começar a usar o Maven, a única coisa necessária são os binários (executáveis) do Maven (<a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a>, cerca de 3 MB). O resto das dependências necessárias ao Maven serão descarregadas automaticamente da primeira vez que um comando Maven (mvn) for executado.</li>
<li>O Maven baseia-se na existência de um ficheiro de &#8220;configuração&#8221; chamado de &#8220;pom.xml&#8221;. Este ficheiro é um XML simples que o Maven irá analisar para executar os seus &#8220;objectivos&#8221; (&#8220;goals&#8221;). Existe um pom.xml para cada projecto / módulo / biblioteca, sendo que estes (os projectos.. ou módulos.. ou bibliotecas..) são chamados de &#8220;artefactos&#8221; no mundo Maven.</li>
<li>Quando se usa Maven, deve-se  evitar ao máximo usar o Eclipse para fazer o &#8220;setup&#8221; do ambiente de desenvolvimento. Sempre que possível, o Maven deverá ser responsável pelo setup do ambiente de dev. Os menus &#8220;Project &gt; Properties&#8221;, e &#8220;Create New Project&#8221; no Eclipse são ferramentas que devemos evitar, pois o Maven consegue (pelo menos em projectos JAVA) criar e (principalmente) actualizar os ficheiros de configuração do Eclipse automaticamente de acordo com as configurações do projecto (veremos isto adiante).</li>
</ol>
</div>
<h2>Caso 1: Configurar um projecto do zero é demorado e aborrecido</h2>
<p>O Maven resolve essa tarefa em dois segundos com um único comando, recorrendo a algo conhecido por &#8220;archetypes&#8221;. Como? Escrevendo:</p>
<pre>mvn archetype:generate</pre>
<p>O Maven irá fazer algumas perguntas (tipo de projecto, package, etc) e irá então criar uma estrutura de directorias base com alguns ficheiros necessários (ou dummy) tipicamente necessários nesse tipo de projectos, utilizando uma estrutura de pacotes pré-definida, e criará um ficheiro pom.xml de base. A estrutura de directorias usada pelo Maven obedece a uma *convenção*, normalmente muito bem definida, que torna permite que developers que estejam a analisar um projecto  pela primeira vez entendam rapidamente a sua estrutura, e onde encontrar todos os recursos. Além disso, a convenção usada pelo Maven reduz em *muito* a complexidade dos arquivos pom.xml do Maven (especialmente quando comparando ao Ant), pois não é necessário adicionar configurações extra ao pom.xml &#8211; O Maven irá &#8220;automaticamente&#8221; encontrar os recursos necessários nos locais correctos, se as convenções forem seguidas &#8211; mas, claro, os developers podem fazer override às convenções, embora não seja recomendável.</p>
<p>Outro dos desconfortos na criação de um projecto a partir do zero, é a configuração do projecto no Eclipse. Descarregar as dependências, adicioná-las à classpath no Eclipse, etc&#8230;, e depois fazer isto novamente em cada um dos postos de trabalho de uma equipa. Porém, graças ao <a href="http://maven.apache.org/plugins/maven-eclipse-plugin/">maven-eclipse-plugin</a>, basta um comando para gerar estas configurações. Fazendo:</p>
<pre>maven eclipse:clean eclipse:eclipse</pre>
<p>serão criados automaticamente os ficheiros de configuração do Eclipse (.project, e restantes), de acordo com as dependências e tipo de projecto definidos no pom.xml. A partir daí, basta que em cada posto de trabalho se faça um &#8220;Import Eclipse Project&#8221; no Eclipse, onde regra geral fica tudo maravilhosamente configurado. Graças ao pom.xml o Maven saberá o suficiente para criar correctamente os ficheiros de configuração do Eclipse. Claro que existem centenas de diferentes tipos de projectos no eclipse com configurações diferentes, e o maven-eclipse-plugin não conhece todas. Mas para JAVA, tem-se portado suficientemente bem para 90% dos meus casos. Os outros 10% são resolvidos facilmente adicionando algumas configurações adicionais no pom.xml.</p>
<p>Em resumo, a utilização de archetypes permite criar a estrutura e configuração de projectos a partir do zero, e o maven-eclipse-plugin permite criar e *actualizar* os ficheiros de configuração do Eclipse, sem ser necessário configurar projecto a projecto cada um dos projectos em cada um dos postos de trabalho à mão (isto, para JAVA, regra geral).</p>
<h2>Caso 2: O meu projecto tem 20 dependências, e cada dependência também tem 10 outras dependências&#8230; Além de ser confuso, perco imenso tempo à procura das bibliotecas, a descarregá-las e configurá-las</h2>
<p>Com o maven, é bastante simples. No pom.xml basta adicionar o seguinte XML para especificar que o projecto tem uma dependência do spring-flex, por exemplo:</p>
<pre><span style="font-family: Verdana, Arial, Geneva, Helvetica, sans-serif; color: #1e1e1e;"><span style="line-height: 20px;">         &lt;dependency&gt;
             &lt;groupId&gt; org.springframework.flex &lt;/groupId&gt;
             &lt;artifactId&gt; spring-flex-core &lt;/artifactId&gt;
             &lt;version&gt; 1.5.0.BUILD-SNAPSHOT &lt;/version&gt;
         &lt;/dependency&gt;</span></span></pre>
<p>E aí basta correr:</p>
<pre>mvn install</pre>
<p>O Maven irá automaticamente encontrar a dependência (chamada de &#8220;artifact&#8221;) &#8211; pesquisando num conjunto de repositórios de dependências -, fazendo o download da mesma e &#8220;instalando-a&#8221; no seu repositório local. Irá fazer o mesmo para todas as dependências de cada dependência recursivamente, pelo que não temos que perder tempo com isso. E a partir daí, sempre que compilar com Maven, este irá adicionar cada uma das dependências ao classpath do compilador automaticamente.</p>
<p>A integração com o Eclipse também é incrível &#8211; ao executar:</p>
<pre>mvn eclipse:clean eclipse:eclipse</pre>
<p>o maven irá actualizar (na verdade, irá recriar) os ficheiros de configuração do Eclipse e adicionar as dependências correctamente ao classpath do projecto. Por outras palavras, algo que regra geral pode ser um autêntico pesadelo (definir as dezenas de dependências de um projecto, descarregá-las da internet, configurá-las, e por sua vez fazer o mesmo para as dependências de cada dependência&#8230;), é resolvido elegantemente em poucos segundos!</p>
<p>Esta simplicidade na gestão das dependências não só facilita a configuração das bibliotecas externas necessárias aos nossos projectos, como fomenta a separação dos nossos projectos em dezenas de módulos e bibliotecas, visto que com Maven se torna relativamente simples organizar todas as relações entre projectos.</p>
<h2>Caso 3: Build através da linha de comandos</h2>
<p>Com Maven, iremos utilizá-lo inevitavelmente para compilar.  A compilação é feita através de plagins, que invocam os compiladores com as directrizes de compilação apropriadas, de acordo com o pom.xml. Isto é, não definimos os argumentos dos compiladores; definimos sim a configuração do projecto, e o maven trata de definir os argumentos, regra geral automaticamente! Além da compilação, o Maven irá utilizar o resultado desta para executar tarefas adicionais, como a execução de unit-testing, geração de relatórios, envio de emails quando ocorrem erros de compilação, etc.</p>
<p>Algo extremamente elegante no Maven, é a forma como ele compila vários projectos em &#8220;simultâneo&#8221;, recursivamente de acordo com a ordem das dependências. Algo que iremos ver posteriormente</p>
<h2>Caso 4: É difícil gerir diferentes versões dos meus projectos/bibliotecas e das suas dependências</h2>
<p>Artefactos (módulos, bibliotecas, etc) possuem sempre um número de versão que lhes é inerente. Isto é, a biblioteca log4j poderá existir na versão 1.1, 1.2, etc. Isto significa que se o nosso projecto precisar do log4j 1.3, basta abrir o pom.xml, localizar a zona onde a dependência é definida (ver o caso 2), e mudar a versão para 1.3. O Maven irá descarregar automaticamente a versão 1.3 e actualizar as definições do projecto. Posteriormente, ao correr mvn eclipse:clean eclipse:eclipse, o Maven vai ainda reconfigurar o Eclipse com a nova versão da dependência. Agora imagine-se que por alguma razão é preciso voltar à versão 1.1 do log4j. Simples. Basta mudar no pom.xml a versão da dependência para 1.1, e o Maven trata do resto.</p>
<p>Mas o que acontece com suas próprias bibliotecas (aliás artefactos) &#8211; como são geridas as versões? Sempre que é executado o &#8220;mvn install&#8221;, o maven faz o build ao projecto, vai criar o package correspondente (i.e. Jar, War) e vai usar o número da versão definido no pom.xml para instalar o artefacto compilado no repositório local (ou online). Um repositório não é mais que um género de &#8220;base de dados&#8221; de bibliotecas gerida automaticamente pelo Maven.</p>
<p>Imagine-se que estamos a implementar o projecto A v1.0, que depende do projecto B v0.5. Temos ainda o projecto C v0.2 que também depende do Projecto B v0.5. Quando se faz o build install do projecto A v1.0, como este depende de B v0.5, o Maven vai primeiro fazer build, (package), e instalar o projecto B v0.5 e só depois o mesmo ao projecto A. Por sua vez, ao fazer build install ao projecto C v0.2, como o artefacto B v0.5 já existe e está instalado, o Maven não recompila o projecto B (excepto se houverem mudanças no código), usando a versão do projecto B v0.5 instalada no repositório.</p>
<p>Agora imaginemos que evoluimos o projecto B, actualizamos a versão para v0.6 no pom.xml. Estas alterações são necessárias ao projecto A, pelo que mudamos também o versão na dependência definida no pom.xml do projecto A. Porém, o projecto C ainda depende da versão v0.5 do projecto B, e não quer as novas alterações. O maven gere isto confortavelmente, pois irá simplesmente usar a versão do artefacto necessária, já previamente instalada no repositório.</p>
<p>Ou seja, elegantemente conseguimos ir evoluindo as versões das nossas bibliotecas &#8220;sem termos que nos preocupar&#8221; com quebrar a compatibilidade com projectos que dependem das mesmas, visto que o número de versão toma aqui um papel muito importante, facilmente gerido pelo Maven. Na realidade, é tão fácil, que quase nos esquecemos de porque é que era tão complicado lidar com diferentes versões das bibliotecas&#8230;!</p>
<h2>Caso 5: O meu projecto consiste em 20 projectos de Eclipse, dependendo uns dos outros e é preciso compilá-los na ordem correcta para que tudo funcione</h2>
<p>Esta é uma tarefa aborrecida no Eclipse, para a qual normalmente usamos o Ant. Mas que o Maven gere de uma forma muito simples, e confortável. Relembrando, cada projecto tem um ficheiro  pom.xml. Os projectos podem ser organizados em níveis. Por exemplo:</p>
<div style="padding-left: 30px;">ProjectA</div>
<div style="padding-left: 60px;">ProjectA-server</div>
<div style="padding-left: 120px;">ProjectA-server-dao</div>
<div style="padding-left: 120px;">ProjectA-server-business</div>
<div style="padding-left: 120px;">ProjectA-server-shared</div>
<div style="padding-left: 120px;">ProjectA-server-adminconsole</div>
<div style="padding-left: 120px;">ProjectA-server-webapp</div>
<div style="padding-left: 60px;">ProjectA-flex-client</div>
<div style="padding-left: 90px;">ProjectA-flex-mainapp</div>
<div style="padding-left: 90px;">ProjectA-flex-moduleA</div>
<div style="padding-left: 90px;">ProjectA-flex-moduleB</div>
<div style="padding-left: 120px;">ProjectA-flex-moduleB-submodule1</div>
<div style="padding-left: 120px;">ProjectA-flex-moduleB-submodule2</div>
<div style="padding-left: 90px;">ProjectA-flex-shared</div>
<p>Cada um dos (artefactos) acima possui um pom.xml. Nos pom.xml &#8220;parent&#8221;, adiciona-se:</p>
<pre> &lt;modules&gt;
      &lt;module&gt;ProjectA-server&lt;/module&gt;
      &lt;module&gt;ProjectA-flex-client&lt;/module&gt;
  &lt;/modules&gt;</pre>
<p>Quando o maven é executado no projecto base, irá analisar a configuração dos módulos, e tentar executar primeiro o build em cada um dos módulos definidos, e por sua vez, em cada um dos sub-módulos, recursivamente na ordem correcta de dependência, &#8220;instalando-os&#8221; no repositório local. Mas claro, é sempre possível indicar ao Maven que queremos compilar só um projecto.</p>
<h2>Caso 6: O projecto está a ser implementado numa equipa, mas é penoso configurar todos os projectos no Eclipse um a um em cada um dos postos de trabalho</h2>
<p>Os ficheiros de projecto (.project) do Eclipse são específicos da máquina em que estão (i.e. um .project configurado no meu computador provavelmente não funcionará no computador do lado), e portanto não é boa prática colocá-los no SCM para partilhar com a equipa. Isto quer dizer que normalmente todos os elementos da equipa têm que criar à mão um novo projecto no Eclipse, configurar as dependências, definir a build path, etc, etc. Por vezes, estas configurações são até um pouco complicadas e demoradas, e algo corre mal, pelo que alguém tem que andar a saltar de estação em estação a ajudar a configurar o ambiente de desenvolvimento. E o pesadelo repete-se sempre que há uma alteração à configuração (novas dependências, novas versões, etc).</p>
<p>Com o Maven, como já foi referido anteriormente, queremos evitar de mexer com nas configurações de projecto do Eclipse. Por outras palavras, o Maven irá, regra geral, tratar desta tarefa automaticamente por nós. Quando escrevemos:</p>
<pre>mvn eclipse:eclipse</pre>
<p>O Maven irá ler o pom.xml, e usá-lo para criar os ficheiros de configuração do Eclipse para esse projecto, e para todos os sub-módulos desse projecto (ver Caso 5). Depois basta fazer um &#8220;Import &gt; Eclipse project&#8221; no Eclipse, e já está, pronto a trabalhar. Naturalmente, já tinha referido isto no caso 1, mas voltei a repeti-lo aqui para reforçar o quão útil é este comportamento no desenvolvimento em equipa, especialmente na configuração inicial do ambiente de desenvolvimento de um novo projecto.</p>
<h2>Mais possibilidades</h2>
<p>Este post podia alongar-se em muitas mais páginas. Como ainda estou a estudar maven, este é o ponto a que já cheguei:</p>
<div id="_mcePaste">
<ul>
<li>Criar a estrutura de projectos de raíz (archetypes), para diferentes tipos de projecto</li>
<li>Configurar projectos Eclipse fora do Eclipse, recorrendo ao Maven</li>
<li>Deixar que o Maven gira automaticamente as dependências dos projectos</li>
<li>Deixar que o Maven gira automaticamente as versões dos projectos</li>
<li>Compilar vários sub-projectos com um único comando, e receber feedback do maven dos resultados de cada um</li>
</ul>
</div>
<p>Mas ainda me falta:</p>
<div id="_mcePaste">
<ul>
<li>Unit Testing &#8211; executar automaticamente todos os unit tests de todos os projectos, analisar o code coverage, etc</li>
<li>Gerar relatórios (de qualidade de código, de resultado das compilações, etc)</li>
<li>Integração com sistemas de continuous integration</li>
<li>Dezenas de outras funcionalidades do Maven</li>
</ul>
</div>
<h2>Em resumo&#8230;</h2>
<p>Resumindo, qualquer pessoa numa equipa pode executar um único comando que irá:</p>
<div id="_mcePaste">
<ol>
<li>&#8220;Encontrar&#8221;, descarregar, e configurar as dependências do projecto;</li>
<li>Configurar o ambiente de desenvolvimento no Eclipse (ficheiros .project)</li>
<li>Fazer o build a todos os projectos relacionados;</li>
<li>Executar os unit tests de todos os projectos;</li>
<li>Criar o packaging correcto para todos os projectos;</li>
<li>Instalar cada projecto (artefacto) no repositório;</li>
<li>Gerar relatórios diversos;</li>
<li>Fazer deploy da aplicação localmente ou online;</li>
<li>Etc&#8230;</li>
</ol>
</div>
<p>Interessa também realçar que os ficheiros pom.xml acabam por se tornar em manuais/guias valiosos para novos developers entenderem muito rapidamente a organização de um sistema complexo. Outro facto de realce, é que o plugin <a href="http://m2eclipse.sonatype.org/">m2Eclipse</a> possui um interface gráfico para editar e gerir os ficheiros pom.xml, simplificando em muito a vida na fase de configuração do projecto.</p>
<p>João Saleiro (<a href="http://www.webfuel.pt">Webfuel</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2011/01/04/porque-aprender-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RIAs made in Portugal &#8211; novo site da Webfuel</title>
		<link>http://www.riapt.org/2010/12/02/rias-made-in-portugal-novo-site-da-webfuel/</link>
		<comments>http://www.riapt.org/2010/12/02/rias-made-in-portugal-novo-site-da-webfuel/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 15:50:02 +0000</pubDate>
		<dc:creator>João Saleiro</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[RIAPT]]></category>
		<category><![CDATA[Rich UI]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.riapt.org/?p=798</guid>
		<description><![CDATA[Lançamos esta semana o novo site da Webfuel, em www.webfuel.pt. O site ainda está em Inglês, mas está nos nossos planos lançar uma versão em Português, com mais conteúdo e também optimizada para Mobile. O video abaixo exemplifica alguns dos nossos trabalhos: Aproveito para agradecer a todos os que nos têm apoiado ao longo destes anos. [...]]]></description>
			<content:encoded><![CDATA[<p>Lançamos esta semana o novo site da Webfuel, em <a href="http://www.webfuel.pt" target="_blank">www.webfuel.pt</a>. O site ainda está em Inglês, mas está nos nossos planos lançar uma versão em Português, com mais conteúdo e também optimizada para Mobile.</p>
<p>O video abaixo exemplifica alguns dos nossos trabalhos:</p>
<p style="text-align: center;"><object id="flash_fallback_1" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="670" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="play" value="true" /><param name="loop" value="true" /><param name="wmode" value="window" /><param name="scale" value="showall" /><param name="menu" value="true" /><param name="devicefont" value="false" /><param name="allowScriptAccess" value="sameDomain" /><param name="src" value="http://www.webfuel.pt/video/vp.swf" /><embed id="flash_fallback_1" type="application/x-shockwave-flash" width="670" height="300" src="http://www.webfuel.pt/video/vp.swf" allowscriptaccess="sameDomain" devicefont="false" menu="true" scale="showall" wmode="window" loop="true" play="true" bgcolor="#000000" quality="high" align="middle"></embed></object></p>
<p>Aproveito para agradecer a todos os que nos têm apoiado ao longo destes anos. Esperamos continuar a inovar, a elevar a fasquia no desenvolvimento de RIAs no nosso país, e a partilhar conhecimento com a comunidade.  Obrigado a todos e espero que gostem do site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riapt.org/2010/12/02/rias-made-in-portugal-novo-site-da-webfuel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

