<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>lucastex.com - Tecnologia e dia-a-dia</title>
	
	<link>http://blog.lucastex.com</link>
	<description>Tecnologia, java, arquitetura e SOA do meu dia-a-dia. Vários posts sobre outros pontos de tecnologia que me interesso e alguma coisa leve sobre automobilismo. </description>
	<lastBuildDate>Fri, 07 Jan 2011 12:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/lucastex" /><feedburner:info uri="lucastex" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>-23.562974</geo:lat><geo:long>-46.650374</geo:long><feedburner:emailServiceId>lucastex</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Open position for Grails Developer</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/nyp3LEKJPfo/</link>
		<comments>http://blog.lucastex.com/2011/01/07/open-position-for-grails-developer/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 12:43:33 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=449</guid>
		<description><![CDATA[Hello, Just returning here to announce an open position for Grails Developer, if you want, or know someone who may want, follow up: The person must have hands on experience with GRAILS. Experience with Oracle (plus) Experience developing highly visited and highly scalable websites Experience using the Grails Web Framework Excellent communication skills Location: Redwood [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>Just returning here to announce an open position for Grails Developer, if you want, or know someone who may want, follow up:</p>
<p>The person must have hands on experience with GRAILS.</p>
<ul>
<li>Experience with Oracle (plus)</li>
<li>Experience developing highly visited and highly scalable websites</li>
<li>Experience using the Grails Web Framework</li>
<li>Excellent communication skills</li>
</ul>
<p><strong>Location</strong>: Redwood City, CA<br />
<strong>Duration</strong>: 3+ months<br />
<strong>Start</strong>: ASAP<br />
<strong>Rate</strong>: Open</p>
<p>Please send resumes to cwelch [at] bluewolf [dot] com (<strong>Charlotte</strong>)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=nyp3LEKJPfo:8vHuHD9laPs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=nyp3LEKJPfo:8vHuHD9laPs:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=nyp3LEKJPfo:8vHuHD9laPs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=nyp3LEKJPfo:8vHuHD9laPs:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/nyp3LEKJPfo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2011/01/07/open-position-for-grails-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2011/01/07/open-position-for-grails-developer/</feedburner:origLink></item>
		<item>
		<title>Blog paused</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/C5J7Zgo4ZiU/</link>
		<comments>http://blog.lucastex.com/2010/04/12/blog-paused/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 12:01:41 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Nenhuma]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=447</guid>
		<description><![CDATA[Hey all, This blog will be &#8216;paused&#8217; for a while. I&#8217;m running on some new apps for clients and this is taking my most time. I&#8217;ll be back soon, thanks a lot, and keep on. @lucastex]]></description>
			<content:encoded><![CDATA[<p>Hey all,</p>
<p>This blog will be &#8216;paused&#8217; for a while.<br />
I&#8217;m running on some new apps for clients and this is taking my most time.</p>
<p>I&#8217;ll be back soon, thanks a lot, and keep on.</p>
<p><a href="http://twitter.com/lucastex">@lucastex</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=C5J7Zgo4ZiU:U1vLF6pAZF4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=C5J7Zgo4ZiU:U1vLF6pAZF4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=C5J7Zgo4ZiU:U1vLF6pAZF4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=C5J7Zgo4ZiU:U1vLF6pAZF4:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/C5J7Zgo4ZiU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2010/04/12/blog-paused/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2010/04/12/blog-paused/</feedburner:origLink></item>
		<item>
		<title>New Grails and Groovy related online board</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/uBfQHS9Djmo/</link>
		<comments>http://blog.lucastex.com/2009/09/05/new-grails-and-groovy-related-online-board/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 15:51:39 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Nenhuma]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=445</guid>
		<description><![CDATA[Hello all, A new Online Board is running up! GR8Forums.org is an online board to group questions, tips, discussions, knowlodge sharing and other stuff that are around Groovy Stuff&#8230; This means Grails Groovy Gradle Gaelyk Gant Any other gr8 stuff it should be there C&#8217;mon, register online and introduce yourself here: http://gr8forums.org/viewtopic.php?f=21&#038;t=3. Come join and [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all,</p>
<p>A new Online Board is running up! <a href="http://gr8forums.org">GR8Forums.org</a> is an online board to group questions, tips, discussions, knowlodge sharing and other stuff that are around Groovy Stuff&#8230; This means</p>
<ul>
<li>Grails</li>
<li>Groovy</li>
<li>Gradle</li>
<li>Gaelyk</li>
<li>Gant</li>
<li>Any other gr8 stuff it should be there</li>
</ul>
<p>C&#8217;mon, register online and introduce yourself here: <a href="http://gr8forums.org/viewtopic.php?f=21&#038;t=3">http://gr8forums.org/viewtopic.php?f=21&#038;t=3</a>.<br />
Come join and bring your groovy friends to the newest gr8 family.</p>
<p>[]s,</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=uBfQHS9Djmo:ZABzoN6smV8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=uBfQHS9Djmo:ZABzoN6smV8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=uBfQHS9Djmo:ZABzoN6smV8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=uBfQHS9Djmo:ZABzoN6smV8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/uBfQHS9Djmo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/09/05/new-grails-and-groovy-related-online-board/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/09/05/new-grails-and-groovy-related-online-board/</feedburner:origLink></item>
		<item>
		<title>Viewing XML files in Safari</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/gGMz5xZN5Yo/</link>
		<comments>http://blog.lucastex.com/2009/09/02/viewing-xml-files-in-safari/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 23:17:56 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Nenhuma]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=442</guid>
		<description><![CDATA[Oh, if you use Mac and Safari, viewing XML files is definitely one of worst things ever. You have to open it and then use the &#8216;view source&#8217; option to handle it. This Safari Plugin called XMLView Plugin can make things easier. Just download it and uncompress it on your $HOME/Library/Internet Plug-Ins folder. Close and [...]]]></description>
			<content:encoded><![CDATA[<p>Oh, if you use Mac and Safari, viewing XML files is definitely one of worst things ever.<br />
You have to open it and then use the &#8216;view source&#8217; option to handle it.</p>
<p><a href="http://www.entropy.ch/software/MacOSX/xmlviewplugin/">This Safari Plugin</a> called XMLView Plugin can make things easier. <img src='http://blog.lucastex.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Just download it and uncompress it on your <strong>$HOME/Library/Internet Plug-Ins</strong> folder.</p>
<p>Close and reopen your Safari, and open <a href="http://www.entropy.ch/software/MacOSX/xmlviewplugin/test.xml">any xml</a>. You&#8217;ll se a well-formated XML with syntax highlight and expand/colapse options.</p>
<p>If you&#8217;re not <a href="http://twitter.com/lucastex">following me on twitter</a>, you own me a dollar for this one.</p>
<p> <img src='http://blog.lucastex.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=gGMz5xZN5Yo:FqwU5Hf1hD8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=gGMz5xZN5Yo:FqwU5Hf1hD8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=gGMz5xZN5Yo:FqwU5Hf1hD8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=gGMz5xZN5Yo:FqwU5Hf1hD8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/gGMz5xZN5Yo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/09/02/viewing-xml-files-in-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/09/02/viewing-xml-files-in-safari/</feedburner:origLink></item>
		<item>
		<title>Grails 1.2 Milestone 2 is out!</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/IdJvuDRjVFg/</link>
		<comments>http://blog.lucastex.com/2009/08/11/grails-1-2-milestone-2-is-out/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 11:21:14 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=439</guid>
		<description><![CDATA[Yeah!! Graeme just announced rigth now that grails 1.2-M2 is out! I&#8217;ve already talked about some changes and improvements in my twitter, but now is officially! Check the release notes here: http://www.grails.org/1.2-M2+Release+Notes, the changelog, and download it to upgrade your applications! Docs, as usual available here: http://grails.org/doc/latest Later, I&#8217;ll write a post about the new [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah!! Graeme <a href="http://twitter.com/graemerocher/status/3243636664">just announced</a> rigth now that grails 1.2-M2 is out!<br />
I&#8217;ve already talked about some changes and improvements in <a href="http://twitter.com/lucastex">my twitter</a>, but now is officially!</p>
<p>Check the release notes here: <a href="http://www.grails.org/1.2-M2+Release+Notes">http://www.grails.org/1.2-M2+Release+Notes</a>, the <a href="http://jira.codehaus.org/browse/GRAILS?report=com.atlassian.jira.plugin.system.project:changelog-panel">changelog</a>, and <a href="http://grails.org/Download">download it</a> to <a href="http://grails.org/doc/latest/ref/Command%20Line/upgrade.html">upgrade your applications</a>!  </p>
<p>Docs, as usual available here: <a href="http://grails.org/doc/latest">http://grails.org/doc/latest</a></p>
<p>Later, I&#8217;ll write a post about the new features, probably one by one, come back!</p>
<p><a href="http://twitter.com/lucastex">Following me on twitter?</a></p>
<p>[]s,</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=IdJvuDRjVFg:ZGkwsuhBzpQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=IdJvuDRjVFg:ZGkwsuhBzpQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=IdJvuDRjVFg:ZGkwsuhBzpQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=IdJvuDRjVFg:ZGkwsuhBzpQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/IdJvuDRjVFg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/08/11/grails-1-2-milestone-2-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/08/11/grails-1-2-milestone-2-is-out/</feedburner:origLink></item>
		<item>
		<title>A simple grails custom validator</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/ExVfC3W4OcM/</link>
		<comments>http://blog.lucastex.com/2009/08/10/a-simple-grails-custom-validator/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 23:52:42 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[constraints]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=436</guid>
		<description><![CDATA[While writing a simple CRUD with #grails, client asked me to validate pogo&#8217;s birth date (had to be in the last year). In this cases, we can&#8217;t just use regular validators, cause their are static. So we can solve this using our own custom validators, so simple and useful. static constraints = { //... borned(validator: [...]]]></description>
			<content:encoded><![CDATA[<p>While writing a simple CRUD with #grails, client asked me to validate pogo&#8217;s birth date (had to be in the last year). In this cases, we can&#8217;t just use regular validators, cause their are static. So we can solve this using our own custom validators, so simple and useful.</p>
<pre class="brush: groovy;">static constraints = {
	//...
	borned(validator: {
		return (it &gt; new Date()-365)
	})
	//...
}</pre>
<p>That&#8217;s it, this way every time a new instance is validated (during save or manually), a new date will be created and compared to it. (no I don&#8217;t care about leap years).</p>
<p>Already <a href="http://twitter.com/lucastex">following me on twitter</a>?</p>
<p>[]s,</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=ExVfC3W4OcM:6iNdWJwUgnE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=ExVfC3W4OcM:6iNdWJwUgnE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=ExVfC3W4OcM:6iNdWJwUgnE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=ExVfC3W4OcM:6iNdWJwUgnE:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/ExVfC3W4OcM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/08/10/a-simple-grails-custom-validator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/08/10/a-simple-grails-custom-validator/</feedburner:origLink></item>
		<item>
		<title>Defining load order and dependencies to your grails plugins</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/I3745JozV0w/</link>
		<comments>http://blog.lucastex.com/2009/07/22/defining-load-order-and-dependencies-to-your-grails-plugins/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 18:04:31 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Nenhuma]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[quicktips]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=429</guid>
		<description><![CDATA[Hello all, I&#8217;m buiding a simple Grails Plugin that will use GORM dynamic finders and methods, but as we should know, the create-plugin grails command just install a fresh skeleton of your grails application, without any other dependencies. First of all, you shoud install the hibernate plugin inside your plugin. Don&#8217;t worry, the hibernate will [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all,</p>
<p>I&#8217;m buiding a simple Grails Plugin that will use GORM dynamic finders and methods, but as we should know, the create-plugin grails command just install a fresh skeleton of your grails application, without any other dependencies.</p>
<p>First of all, you shoud install the hibernate plugin inside your plugin. Don&#8217;t worry, the hibernate will not be packaged with your plugin, but will be there to your plugin classes use.</p>
<pre class="brush: groovy;">grails install-plugin hibernate</pre>
<p>So, now your plugin have the hibernate plugin installed and will be capable to use GORM facilities. But, if people wants to use your plugin, they will have to have hibernate plugin installed, correct? I know it cames by default in our grails application, but can be uninstalled. So we have to find some way to make our plugin dependent on hibernate plugin. Asking on the <a href="http://www.nabble.com/grails---user-f11861.html">grails-user list</a> and reading <a href="http://www.grails.org/Plugin+Dependencies">this topic in grails.org wiki</a>, I remembered on two plugin configurations that can help us:</p>
<ul>
<li>dependsOn</li>
<li>loadAfter</li>
</ul>
<p>The dependsOn it&#8217;s a map inside our XptoGrailsPlugin that tells witch plugins our one depends, it takes the name of the respective plugin and its version, in my case, that&#8217;s what I did:</p>
<pre class="brush: groovy;">def dependsOn = [&quot;hibernate&quot;:&quot;1.1 &gt; *&quot;]</pre>
<p>So, our plugin will depend on grails hibernate plugin, and at least the 1.1 version of it, none previous will be accepted and any future ones will be ok!</p>
<p>But sometimes this is not enougth, besides being dependent, our plugin uses dynamic finders, and runtime added method on our domain classes, so, it&#8217;ll only be successfully loaded after hibernate plugin load and adds this methods. To achieve this, we&#8217;ll use the other tag, the loadAfter to tell that our plugin will wait hibernate plugin to be loaded and the load itself.</p>
<pre class="brush: groovy;">def loadAfter = ['hibernate']</pre>
<p>That&#8217;s it. Doing this we&#8217;ll make things work as we wanted.</p>
<p>PS.: just noticed, right now that Graeme Rocher pushed to github&#8217;s grails master branch, a commit that will install de default plugins into new plugin projetcs too. This sounds cool, and will avoid us the first step above, the plugin installation. Here is the commit id and link: <a href="http://github.com/grails/grails/commit/9cb23f5b835b633cf43079ca7e58e29c64bd3b3c">9cb23f5b835b633cf43079ca7e58e29c64bd3b3c</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=I3745JozV0w:AZ-5-rzqawA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=I3745JozV0w:AZ-5-rzqawA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=I3745JozV0w:AZ-5-rzqawA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=I3745JozV0w:AZ-5-rzqawA:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/I3745JozV0w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/07/22/defining-load-order-and-dependencies-to-your-grails-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/07/22/defining-load-order-and-dependencies-to-your-grails-plugins/</feedburner:origLink></item>
		<item>
		<title>Problems with this blog, I’m back.</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/wkjjOBDTVh8/</link>
		<comments>http://blog.lucastex.com/2009/07/17/problems-with-this-blog-im-back/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 12:56:54 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Day by day]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=420</guid>
		<description><![CDATA[Ok. Yesterday when I just finished posting a new blog entry, my wordpress just froze. Everything stopped working, just a blank screen all over the pages (even admin ones). I restored this backup from the day before yesteday, but I thin I lost all usage, visitors and analytics data. A shame This is a fresh [...]]]></description>
			<content:encoded><![CDATA[<p>Ok.</p>
<p>Yesterday when I just finished posting a new blog entry, my wordpress just froze. Everything stopped working, just a blank screen all over the pages (even admin ones). I restored this backup from the day before yesteday, but I thin I lost all usage, visitors and analytics data. A shame <img src='http://blog.lucastex.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>This is a fresh new installation, will configure everything again, plugins, snippets, rss, etc&#8230; Sorry guys, hope you all understand.</p>
<p>And the tutorials are coming, just working this last 2 months more than I planned/like.</p>
<p>See ya,</p>
<p>[]s,</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=wkjjOBDTVh8:iWa1cF0CYuQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=wkjjOBDTVh8:iWa1cF0CYuQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=wkjjOBDTVh8:iWa1cF0CYuQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=wkjjOBDTVh8:iWa1cF0CYuQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/wkjjOBDTVh8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/07/17/problems-with-this-blog-im-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/07/17/problems-with-this-blog-im-back/</feedburner:origLink></item>
		<item>
		<title>A metaprogramação em linguagens dinâmicas</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/N4gkedW4dYQ/</link>
		<comments>http://blog.lucastex.com/2009/07/16/a-metaprogramacao-em-linguagens-dinamicas/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 13:46:11 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Nenhuma]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=425</guid>
		<description><![CDATA[Vamos imaginar que gostaríamos de &#8220;adicionar comportamentos específicos&#8221; aos nossos objetos já escritos. Neste caso, usando a pura, tradicional, cafona e obsoleta orientação a objetos, estaríamos travados e acabaríamos por optar por uma composição de objetos, ou quem sabe uma generalização, certo? Uma das maiores vantagens (e perigos caso o programador seja na verdade um [...]]]></description>
			<content:encoded><![CDATA[<p>Vamos imaginar que gostaríamos de &#8220;adicionar comportamentos específicos&#8221; aos nossos objetos já escritos. Neste caso, usando a pura, tradicional, cafona e obsoleta orientação a objetos, estaríamos travados e acabaríamos por optar por uma composição de objetos, ou quem sabe uma generalização, certo? Uma das maiores vantagens (e perigos caso o programador seja na verdade um macaco de código), é o uso da <span>metaprogramação</span>. A metaprogramaçao nos permite exatamente isto, adicionar funções, e alterar o &#8220;esqueleto comportamental&#8221; de classes e objetos, por exemplo.</p>
<p>Para uma classe onde temos nosso cachorro, que anda:<br />
<span style="font-size: xx-small;"><br />
<span style="font-family: courier new,monospace;">class Dog {</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;"> &nbsp;&nbsp;def walk() {</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;"> &nbsp;&nbsp;&nbsp;&nbsp;println &#8220;walking&#8230;&#8221;</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;"> &nbsp;&nbsp;}</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">}</span></span><br style="font-family: courier new,monospace;" /><br />
se quisessemos definir um método para que ele latisse em runtime, faríamos da seguinte maneira:</p>
<p><span style="font-size: xx-small;"><span style="font-family: courier new,monospace;">def dog = new Dog()</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">dog.walk() //walking&#8230;</span><br style="font-family: courier new,monospace;" /><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">//Neste ponto, se fizermos a chamada dog.bark() teremos</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">//uma exception por estarmos chamando um método inexistente.</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">//Poderíamos contornar o erro com a implementação do methodMissing</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">//como dito no outro post, ou então da seguinta maneira</span><br style="font-family: courier new,monospace;" /><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">dog.metaClass.bark = {</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;"> &nbsp;&nbsp;println &#8220;au.&#8221;</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;" /> <br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">//Pronto, após isto, é só latir</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">dog.bark() //au.</span><br style="font-family: courier new,monospace;" /> </span><br />
Poderíamos também trabalhar com parâmetros da função</p>
<p><span style="font-size: xx-small;"><span style="font-family: courier new,monospace;">dog.metaClass.bark = { vezes -&gt;</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;"> vezes.times {</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;"> println &#8220;au.&#8221;</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;" /><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">dog.bark(5)</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">//au.</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">//au.</span><br style="font-family: courier new,monospace;" /><span style="font-family: courier new,monospace;">//au.</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">//au.</span><br style="font-family: courier new,monospace;" /> <span style="font-family: courier new,monospace;">//au.</span><br style="font-family: courier new,monospace;" /></span><br />
Neste caso, definimos o comportamento do método bark() em runtime, para um objeto já existente. Se quisessemos agora, unir os comportamentos de um objeto, em outro, poderíamos usar o recurso de mixin de objetos, que traz as definições de métodos e funçoes de um objeto para outro. Tendo a definição de um pato, onde:</p>
<p><span style="font-size: xx-small;">class Duck {<br />
&nbsp;&nbsp;def quack() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;println &#8220;quack!&#8221;<br />
&nbsp;&nbsp;}<br />
}<br />
</span><br />
Fica fácil fazer com que o pato ande como um cachorro! (absorvendo a função definida na classe Dog) <img src='http://blog.lucastex.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="font-size: xx-small;">def duck = new Duck()</span><br />
<span style="font-size: xx-small;">duck.quack() //quack!</span></p>
<p><span style="font-size: xx-small;">//dedo de deus</span><br />
<span style="font-size: xx-small;">duck.metaClass.mixin Dog</span></p>
<p><span style="font-size: xx-small;">duck.walk() //walking</span></p>
<p>É isso aí.</p>
<p>[]s,</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=N4gkedW4dYQ:NlmUb9ndk1U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=N4gkedW4dYQ:NlmUb9ndk1U:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=N4gkedW4dYQ:NlmUb9ndk1U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=N4gkedW4dYQ:NlmUb9ndk1U:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/N4gkedW4dYQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/07/16/a-metaprogramacao-em-linguagens-dinamicas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/07/16/a-metaprogramacao-em-linguagens-dinamicas/</feedburner:origLink></item>
		<item>
		<title>Interceptando métodos inexistentes em Groovy</title>
		<link>http://feedproxy.google.com/~r/lucastex/~3/fpYih4AyRRE/</link>
		<comments>http://blog.lucastex.com/2009/07/06/interceptando-metodos-inexistentes-em-groovy/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 18:15:14 +0000</pubDate>
		<dc:creator>lucastex</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://blog.lucastex.com/?p=410</guid>
		<description><![CDATA[As linguagens dinâmicas estão ganhando um espaço considerável hoje em dia. Para dar um exemplo do poder dessas linguagens, criei um exemplo simples em Groovy (linguagem Java que roda &#8220;em cima&#8221; da JVM). Uma das características dessas linguagens, é poder aproveitar a criatividade do desenvolvedor. Daí temos como exemplo uma função que pode ser definida [...]]]></description>
			<content:encoded><![CDATA[<p>As linguagens dinâmicas estão ganhando um espaço considerável hoje em dia. Para dar um exemplo do poder dessas linguagens, criei um exemplo simples em Groovy (linguagem Java que roda &#8220;em cima&#8221; da JVM).</p>
<p>Uma das características dessas linguagens, é poder aproveitar a criatividade do desenvolvedor. Daí temos como exemplo uma função que pode ser definida em nossos objetos chamada <strong>methodMissing</strong>. Essa função é chamada quando algum método não encontrado é chamado em algum objeto. Caso não seja definida, aí sim temos o comportamento padrão do Java, uma exception apontando a falta do método.</p>
<p>No <a href="http://twitter.com/lucastex">twitter</a>, o <a href="http://twitter.com/cmilfont/status/2441669599">@cmilfont perguntou ao @fabiokung</a> sobre um builder de HTML que ele tinha feito em ruby com o mesmo princípio. Usar o methodMissing. Quando eu vi <a href="http://gist.github.com/72852">este builder</a>, fiquei pasmo com a simplicidade e objetividade, e tudo isso originou este post. Coloquei alguns tratamentos que não existiam, para valores de atributos das tags.</p>
<p>O exemplo utiliza o poder da função methodMissing para criar um &#8220;Builder&#8221;, ou então um construtor de HTML dinâmico com base em pseudo-métodos chamados pelo cliente. Imaginem a função abaixo:</p>
<pre>def methodMissing(String name, params) {
	if (params[0] instanceof Closure) {
		println "< ${name}>"
		params[0].call()
		println "< / ${name}>"
	} else if (params[0] instanceof String) {
		println "< ${name}>${params[0]}< ${name}>"
	} else if (params[0] instanceof Map) {
		print "< ${name}"
		params[0].each() {chave, valor ->
			print " ${chave}=\"${valor}\""
		}
		if (params.length > 1) {
			if (params[1] instanceof Closure) {
				println ">"
				params[1].call()
				println ""
			}
		} else println " />"
	}
}</pre>
<p>No primeiro if, resgatando o parâmetro do tipo closure, apenas faz a chamada a esta closure, para que o novo método seja chamado entre &#8220;TAGS&#8221; que são o nome do método criado dinâmicamente&#8230; Já no caso do parâmetro ser uma String, é encarada como conteúdo  inteno da tag e renderizada desta maneira.</p>
<p>Se um map for passado como parâmetro, a interpretação é tida como vários atributos da tag html (método inexistente), e caso ainda tenhamos uma outra closure ali como parâmetro, o comportamento é repetido <img src='http://blog.lucastex.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Com este exemplo, poderíamos construir um simples HTML com o seguinte trecho de código (script) groovy:</p>
<pre>html {
    head {
        title "teste de titulo"
    }
    body {
        div(id:3, class:"odd") {
            p "meu texto"
        }
        div id:5, class:"xpto"
    }
}</pre>
<p>Prontinho, a JVM com o trecho acima cria nosso super-mega-ultra-elaborado trecho de HTML:</p>
<pre>
< html >
< head >
< title >teste de titulo< / title >
< / head >
< body >
< div id="3" class="odd" >
< p >meu texto< / p >< / div >
< div id="5" class="xpto" / >
< / body >
< / html >
</pre>
<p>Groovy é uma linguagem de script muito bacana e poderosa, e como roda em cima da JVM, não é nada mais que Java puro. Pode com certeza e MUITA eficiência substituir aqueles scripts shell que temos em algumas aplicações, trazendo para os desenvolvedores mais liberdade (de chamar um jar com funcionalidades, por exemplo), e conforto (de não depender de alguém de infra estrutura, ou de conhecimento em shell script).</p>
<p>Fica aí a dica e o exemplo do poder&#8230;</p>
<p>Valeu!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/lucastex?a=fpYih4AyRRE:tGtAmYPMwXw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=fpYih4AyRRE:tGtAmYPMwXw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/lucastex?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/lucastex?a=fpYih4AyRRE:tGtAmYPMwXw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/lucastex?i=fpYih4AyRRE:tGtAmYPMwXw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/lucastex/~4/fpYih4AyRRE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.lucastex.com/2009/07/06/interceptando-metodos-inexistentes-em-groovy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.lucastex.com/2009/07/06/interceptando-metodos-inexistentes-em-groovy/</feedburner:origLink></item>
	</channel>
</rss>
