<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BlackBerry Developer Blog &#187; components</title>
	<atom:link href="http://devblog.blackberry.com/tag/components/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 15:08:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devblog.blackberry.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9ef0a66c09615fa946c4179662398878?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>BlackBerry Developer Blog &#187; components</title>
		<link>http://devblog.blackberry.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://devblog.blackberry.com/osd.xml" title="BlackBerry Developer Blog" />
	<atom:link rel='hub' href='http://devblog.blackberry.com/?pushpress=hub'/>
		<item>
		<title>QML/Cascades tip of the day &#8211; Namespaces</title>
		<link>http://devblog.blackberry.com/2012/06/qml-cascades-tip-namespaces/</link>
		<comments>http://devblog.blackberry.com/2012/06/qml-cascades-tip-namespaces/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 18:34:31 +0000</pubDate>
		<dc:creator>Alex Kinsella</dc:creator>
				<category><![CDATA[Cascades]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[Namespaces]]></category>
		<category><![CDATA[QML]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=9906</guid>
		<description><![CDATA[Today's tip is about namespaces in QML and how they can be utilized to avoid name clashes.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=9906&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><em>Here&#8217;s Mario with another tip for developing with Cascades™ &#8211; Ed.</em></p>
<p>Today&#8217;s tip is about namespaces in QML and how they can be utilized to avoid name clashes.</p>
<p>When importing a module in QML &#8211; <em>bb.cascades</em>, for example – the content is imported in to the global namespace. In practice, this means that you can use a component from the module without using a qualifier. For example:</p>
<pre>import bb.cascades 1.0
...
Label {
    text: “Hello World”
}
...</pre>
<p style="text-align:center;"><em>As you can see, the Label is used without specifying a qualifier.</em></p>
<p>Let&#8217;s say you have your own <em>Label</em> component in the <em>org/mydomain</em> module. If you want to use both the Cascades <em>Label</em> and the <em>org/mydomain&#8217;s Label</em> in the same QML document, you’ve got yourself a name clash. Fortunately, this is very easy to resolve by using the import statement&#8217;s <em><strong>as</strong></em> keyword:</p>
<pre>import bb.cascades 1.0
import “org/mydomain” as MyComponents</pre>
<p style="text-align:center;"><em>The uppercase letter in the namespace name is mandatory.</em></p>
<p>To use the org/mydomain Label, you simply put the qualifier in front of the component name:</p>
<pre>// This is a 'Cascades label'
Label {
    text: “Hello Cascades Label”
}

// This is a 'MyComponents label'
MyComponents.Label {
    text: “Hello MyComponents Label”
}</pre>
<p>That&#8217;s it! You don&#8217;t have to come up with creative names to avoid name clashes – just use namespaces. Even better, you don&#8217;t have to prefix components with all those two- or three-letter acronyms, which you often see in frameworks for languages not supporting namespaces (such as objective-c).</p>
<p>For a complete example, visit <a href="https://github.com/mariob/cascades-namespace-example" target="_new">https://github.com/mariob/cascades-namespace-example</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/9906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/9906/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=9906&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2012/06/qml-cascades-tip-namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d0e94a7e96e80d5911732d43f31a39c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex K.</media:title>
		</media:content>
	</item>
	</channel>
</rss>
