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

<channel>
	<title>Fábio Vedovelli</title>
	<atom:link href="http://www.vedovelli.com.br/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vedovelli.com.br/english</link>
	<description>It’s all about technology</description>
	<pubDate>Thu, 29 May 2008 00:47:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Flex: understanding packages</title>
		<link>http://www.vedovelli.com.br/english/2008/05/28/flex-understanding-packages/</link>
		<comments>http://www.vedovelli.com.br/english/2008/05/28/flex-understanding-packages/#comments</comments>
		<pubDate>Thu, 29 May 2008 00:44:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Actionscript3]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Object Oriented stuff]]></category>

		<category><![CDATA[Object Oriented Programming]]></category>

		<guid isPermaLink="false">http://www.vedovelli.com.br/english/?p=3</guid>
		<description><![CDATA[When I started learning Flex, everytime I&#8217;ve researched for something in the oficial docs or in blogs and my eyes came across the word PACKAGES I used to be scared and thought that word was there just to confuse me.
After losing my fear about the unknown, I&#8217;ve understood that the packages were there just to [...]]]></description>
			<content:encoded><![CDATA[<p>When I started learning Flex, everytime I&#8217;ve researched for something in the oficial docs or in blogs and my eyes came across the word PACKAGES I used to be scared and thought that word was there just to confuse me.</p>
<p>After losing my fear about the unknown, I&#8217;ve understood that the packages were there just to make my app more organized and easier to manage.</p>
<p>Let&#8217;s take a look: the Object Oriented programming allows us to extend native or custom classes. If you don&#8217;t know what it is to extend a class, I recomend a quick research on Google. For a semanthics concern and for your customized classes, inherited from other class or not, do not conflict with native classes&#8217; name, the concept of packages was created, wich work the same way as folders, in a file system.</p>
<p>So, it is so commom to find, in Flex programming or in Java programming, the following structure:</p>
<p><strong>br/com/vedovelli/classes<br />
br/com/vedovelli/assets<br />
br/com/vedovelli/scripts<br />
</strong><br />
And when importing into you app, you should do something like this:</p>
<p>import br.com.vedovelli.classes.* that means import everything from folder classes, that is inside vedovelli, that is inside com that is inside br.</p>
<p>On class creation, the right way is do the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="actionscript">     package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">vedovelli</span>.<span style="color: #006600;">classes</span><span style="color: #66cc66;">&#123;</span>
           <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Example<span style="color: #66cc66;">&#123;</span>
           <span style="color: #66cc66;">&#125;</span>
     <span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Seems unnecessary, isn&#8217;t it? But, without that, there&#8217;s a risk of use reserved names when creating our classes and custom components. You don&#8217;t need to use the convention of reverse DNS structure (br.com.vedovelli) but the developers community recomends it as a good practice.</p>
<p>Regards from Brazil.</p>
<p>Ved</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vedovelli.com.br/english/2008/05/28/flex-understanding-packages/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
