<?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>hugomonteiro.net</title>
	<atom:link href="http://hugomonteiro.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://hugomonteiro.net</link>
	<description>&#34;When two men in business always agree, one of them is unnecessary.&#34; - William Wrigley Jr.</description>
	<lastBuildDate>Thu, 24 Jun 2010 10:10:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to motivate your employees</title>
		<link>http://hugomonteiro.net/2010/06/24/how-to-motivate-your-employees/</link>
		<comments>http://hugomonteiro.net/2010/06/24/how-to-motivate-your-employees/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 10:10:08 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[motivation]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=362</guid>
		<description><![CDATA[Every now and then we discover that our employees are very unmotivated by what they are doing. Most of the problems are related with project management, working extra-hours, lack of goals, etc. To solve most of the problems the leader needs to motivate each employee using a different approach, because not everyone are equal: For [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then we discover that our employees are very unmotivated by what they are doing. Most of the problems are related with project management, working extra-hours, lack of goals, etc.</p>
<p>To solve most of the problems the leader needs to motivate each employee using a different approach, because not everyone are equal:</p>
<ul>
<li>For a emotional person you need to show that the project will change a lot of people for the better, so they can feel the passion and the purpose of doing it. They need to feel that they are part of something bigger.</li>
<li>For a mental person, you need to show the advantages and the project impact in their productivity and knowledge. They value a lot the project organization and they always want to know deadlines.</li>
</ul>
<p>A good company is the one who puts the PEOPLE in first place instead of always searching for more profit.</p>
<p>From my point of view, I think we can change the world if you change the people we work and talk every day.</p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/06/24/how-to-motivate-your-employees/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Schools kill creativity</title>
		<link>http://hugomonteiro.net/2010/05/29/schools-kill-creativity/</link>
		<comments>http://hugomonteiro.net/2010/05/29/schools-kill-creativity/#comments</comments>
		<pubDate>Sat, 29 May 2010 12:36:48 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[Education]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=360</guid>
		<description><![CDATA[Ken Robinson talks about how the educational system is killing student creativity.]]></description>
			<content:encoded><![CDATA[<p>Ken Robinson talks about how the educational system is killing student creativity. </p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="334" height="326" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="bgColor" value="#ffffff" /><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/SirKenRobinson_2006-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/SirKenRobinson-2006.embed_thumbnail.jpg&amp;vw=320&amp;vh=240&amp;ap=0&amp;ti=66&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=ken_robinson_says_schools_kill_creativity;year=2006;theme=how_we_learn;theme=the_creative_spark;theme=bold_predictions_stern_warnings;theme=master_storytellers;theme=how_the_mind_works;theme=top_10_tedtalks;event=TED2006;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><param name="src" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" /><param name="bgcolor" value="#ffffff" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="334" height="326" src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" flashvars="vu=http://video.ted.com/talks/dynamic/SirKenRobinson_2006-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/SirKenRobinson-2006.embed_thumbnail.jpg&amp;vw=320&amp;vh=240&amp;ap=0&amp;ti=66&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=ken_robinson_says_schools_kill_creativity;year=2006;theme=how_we_learn;theme=the_creative_spark;theme=bold_predictions_stern_warnings;theme=master_storytellers;theme=how_the_mind_works;theme=top_10_tedtalks;event=TED2006;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" bgcolor="#ffffff" wmode="transparent" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/05/29/schools-kill-creativity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying PlayFramework Apps in JBoss</title>
		<link>http://hugomonteiro.net/2010/04/01/deploying-playframework-apps-in-jboss/</link>
		<comments>http://hugomonteiro.net/2010/04/01/deploying-playframework-apps-in-jboss/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 17:19:57 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=352</guid>
		<description><![CDATA[After you created your web application you need to create the WAR file that will insert the framework and other dependent libs inside the folder that you specify: play war myapp -o myapp.war Now to deploy on JBoss, you need to do some changes on your WAR file: Create a file called jboss-web.xml in the [...]]]></description>
			<content:encoded><![CDATA[<p>After you created your web application you need to create the WAR file that will insert the framework and other dependent libs inside the folder that you specify:</p>
<pre>play war myapp -o myapp.war
</pre>
<p>Now to deploy on <a href="http://www.jboss.com/">JBoss</a>, you need to do some changes on your WAR file:</p>
<ul>
<li>Create a file called<strong><em> <strong>jboss</strong>-web.xml </em></strong>in the myapp.war/WEB-INF/ directory container the  following:</li>
</ul>
<pre class="brush: xml;" >
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;&nbsp;?&gt;
&lt;!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd"&gt;
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
com.example:archive=myapp.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
</pre>
<ul>
<li>Download hibernate-validator and hibernate annotation using the compatibility matrix (<a title="Hibernate Compatibility Matrix" href="http://74.125.77.132/search?q=cache:Q9VmeUcio1MJ:https://www.hibernate.org/6.html+https://www.hibernate.org/6.html%23A3&amp;cd=1&amp;hl=nl&amp;ct=clnk&amp;gl=nl&amp;client=safari">Hibernate Compatibility Matrix</a>).  Play is using hibernate core 3.3.2 GA. Once you are done, place the  relevant jars in the myapp.war/WEB-INF/lib directory. You should end up with:
<ul>
<li>hibernate-annotations.jar</li>
<li>hibernate-entitymanager.jar</li>
<li>hibernate-validator.jar</li>
<li>hibernate-commons-annotations.jar</li>
<li>hibernate-search-3.1.1.GA.jar</li>
<li>hibernate3.jar (Do not overwrite this library, as Play! has a modified version of it)</li>
</ul>
</li>
<li>Now that we&#8217;re prepared for WAR, you need to move your application to the deployment folder of JBoss. The default folder for it is: <em>jboss_home/server/default/deploy </em>(jboss_home == folder of jboss). There are some things you need to be aware of:<em><br />
</em></p>
<ol>
<li>Use a superior java version in JBoss to avoid class version errors</li>
<li>Verify that the WAR folder has the necessary permissions. In my case I needed to make a &#8220;<em>chown -R jboss myapp.war</em>&#8221; where jboss is the user that controls the jboss application server</li>
<li>Do a &#8220;<em>tail -f jboss_home/server/default/log/server.log</em>&#8221; to see if your application is being deployed. You&#8217;ve an Administration Console in <em>http://yourserverip:8080</em></li>
<li>Don&#8217;t change your routes file at runtime<em>. Stop the war, change routes and then start the war (in the administration console I said before)<br />
</em></li>
</ol>
</li>
<li>Now you should have your application working. You can access to your app at: <em>http://yourserverip:8080/myapp.war</em></li>
<li><strong>This tutorial was tested in JBoss 5.0.1</strong><em><br />
</em></li>
</ul>
<p>Thanks to <a href="http://www.twitter.com/nicolasleroux">Nicolas Leroux</a> from <a href="http://lunatech.com">lunatech.com</a> for helping me to create this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/04/01/deploying-playframework-apps-in-jboss/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Send file to user using views</title>
		<link>http://hugomonteiro.net/2010/03/16/send-a-file-to-user-using-a-view-with-play-framework/</link>
		<comments>http://hugomonteiro.net/2010/03/16/send-a-file-to-user-using-a-view-with-play-framework/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 15:36:19 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[send]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=333</guid>
		<description><![CDATA[There are some simple steps to send a file to the user of your web application using the Play Framework: 1. After the controller is created (what I do is to copy the controller  &#8220;Application&#8221; and do a refactor rename to the name I want). Create a file named MyController (what I do is to [...]]]></description>
			<content:encoded><![CDATA[<p>There are some simple steps to send a file to the user of your web application using the <a href="http://www.playframework.org/">Play Framework</a>:</p>
<p>1. After the controller is created (what I do is to copy the controller  &#8220;Application&#8221; and do a refactor rename to the name I want).</p>
<ol>
<li>Create a file named MyController (what I do is to copy the controller  &#8220;Application&#8221; and do a rename to the name I want &#8211; in this case i chose the name MyController)</li>
<li>After this, you need to create a folder with the same name of the controller (in this case: MyController) &#8211; app/views/MyController</li>
<li>Now in the controller, you&#8217;ve to create an index method, where you&#8217;ll output data for the user, for instance:
<ol>
<li>
<pre>public static void index() {
    List users = User.all().fetch();
    render(users);
}</pre>
</li>
<li> Now you need to create a method that will create the file, or get the file somewhere:
<pre>public static void generateMyDocument() {
       File f = new File("myFile.xls");
       //now you've to edit the file, in this is case is an excel file,
       //so you can edit using a library like <a href="http://jexcelapi.sourceforge.net/">JExcelAPI</a></pre>
<pre>       //set the header with the size of the file
       response.setHeader("Content-Length", String.valueOf(f.length()));
       //set the content type, in this case is a microsoft excel
       response.contentType = "application/ms-excel";
       //send the file to the user
       renderBinary(f);
       //after I send the file, I want to return to the same page (index())
       index();
}</pre>
</li>
</ol>
</li>
<li>Now we need to create a view, inside that folder we just created (create an index.html file):
<ul>
<li>
<pre>&lt;a href="@{generateMyDocument()}"&gt;Download file&lt;/a&gt;</pre>
<p>We are calling the method from the controller. First we have the folder with the same name that will route directly to the method of the controller.Off course that we could do this:</li>
<pre>      &lt;a href="@{MyController.generateMyDocument()}"&gt;Download file&lt;/a&gt;</pre>
<p>And that&#8217;s it. The magic on the <a href="http://www.playframework.org">Play Framework</a> is done .</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/03/16/send-a-file-to-user-using-a-view-with-play-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security tips for a web developer</title>
		<link>http://hugomonteiro.net/2010/03/13/security-tips-for-a-web-developer-specially-using-the-playframework/</link>
		<comments>http://hugomonteiro.net/2010/03/13/security-tips-for-a-web-developer-specially-using-the-playframework/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 11:24:15 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=293</guid>
		<description><![CDATA[Every web application has two sides. The client side and the server side. Everything on the client side can be changed, and most of the security problems happens when you trust in the client. With a simple proxy (like webscarab) you can edit the fields that were validated using javascript. That&#8217;s why you always need [...]]]></description>
			<content:encoded><![CDATA[<p>Every web application has two sides. The client side and the server side. Everything on the client side can be changed, and most of the security problems happens when you trust in the client. With a simple proxy (like <a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project">webscarab</a>) you can edit the fields that were validated using javascript. That&#8217;s why you always need to validate the data on the server side. <a href="http://www.playframework.org/">Play Framework</a> has grown to be a great framework for this, giving advantages such as using annotations to control the type of data that came from the client side.</p>
<p>So, a great way to think out of box is to use those validation features inside the model, that every good MVC Framework has, and don&#8217;t trust to much on using hidden fields in the HTML that when changed can affect other users inside the web application. For instance, if you have an hidden field that has the id of the user, and if I change that, I can change others users data.</p>
<p><strong>So, in conclusion:<br />
</strong></p>
<ul>
<li>You can use cookies and sessions to know which user is authenticated (inside the model you can have the stuff he can do on the web application)</li>
<li>Don&#8217;t trust in the client side. Use always server and client validation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/03/13/security-tips-for-a-web-developer-specially-using-the-playframework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leadership Lessons from Dancing Guy</title>
		<link>http://hugomonteiro.net/2010/02/14/leadership-lessons-from-dancing-guy/</link>
		<comments>http://hugomonteiro.net/2010/02/14/leadership-lessons-from-dancing-guy/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 19:02:44 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[followers]]></category>
		<category><![CDATA[leadership]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=288</guid>
		<description><![CDATA[Read transcrip at http://sivers.org/ff . Great Lesson!]]></description>
			<content:encoded><![CDATA[<p>Read transcrip at <a href="http://sivers.org/ff">http://sivers.org/ff </a>.</p>
<p>Great Lesson!</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/fW8amMCVAJQ&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/fW8amMCVAJQ&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/02/14/leadership-lessons-from-dancing-guy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play Framework + Oracle = EASY!</title>
		<link>http://hugomonteiro.net/2010/01/28/oracle-play-framework-easy/</link>
		<comments>http://hugomonteiro.net/2010/01/28/oracle-play-framework-easy/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 12:18:02 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=277</guid>
		<description><![CDATA[To configure your oracle database using the play framework you need to follow the following steps: Choose the JAR with the drivers according to your oracle&#8217;s database version and put in the lib/ directory of your web application Configure your application.conf file,  located inside the conf/ directory In the JPA Configuration Section you have to [...]]]></description>
			<content:encoded><![CDATA[<p>To configure your oracle database using the <a href="http://www.playframework.org/">play framework</a> you need to follow the following steps:</p>
<ol>
<li>Choose the <a href="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html">JAR</a> with the drivers according to your oracle&#8217;s database version and put in the <em>lib/</em> directory of your web application</li>
<li>Configure your application.conf file,  located inside the <em>conf/</em> directory
<ul>
<li>In the JPA Configuration Section you have to choose the <a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-optional-dialects">JPA (Hibernate) dialect</a>. In my case I was working with oracle10g so i had to insert in the configuration file:
<ul>
<li>
<pre>jpa.dialect=org.hibernate.dialect.Oracle10gDialect</pre>
</li>
</ul>
</li>
<li>Now you just need to add the following lines, according to your database (including username and password).
<ul>
<li>
<pre>db.url=jdbc:oracle:thin:@yourdatabaseserver:1521:dbname
db.driver=oracle.jdbc.driver.OracleDriver
db.user=yourusername
db.pass=yourpassword</pre>
</li>
</ul>
</li>
</ul>
</li>
<li>Now you just need to restart the server. He adds the database drivers automatically to the classpath of the project.</li>
<li>If you want, you can generate <a href="http://www.netbeans.org">Netbeans</a> or <a href="http://www.eclipse.org">Eclipse</a> projects, so you can open this projects with everything configured.</li>
</ol>
<p>Really easy with no XMLs!</p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/01/28/oracle-play-framework-easy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[Play] Iterate over objects using jQuery</title>
		<link>http://hugomonteiro.net/2010/01/12/how-to-navigate-into-each-html-element-using-jquery/</link>
		<comments>http://hugomonteiro.net/2010/01/12/how-to-navigate-into-each-html-element-using-jquery/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:13:49 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[play]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=208</guid>
		<description><![CDATA[What if I want to navigate into each checkbox, radio of my html? You can do it pretty easily using jQuery.each function. In every checkbox element I want to send a post message to my Play Framework. ﻿﻿jQuery.each($(':checkbox'), function() { $﻿.post('@{myPlayMethod()}', { itemValue: $(this).val() }) });﻿ This code sends the html element value property to [...]]]></description>
			<content:encoded><![CDATA[<p>What if I want to navigate into each checkbox, radio of my html? You can do it pretty easily using <a href="http://docs.jquery.com/Utilities/jQuery.each">jQuery.each function</a>.</p>
<p>In every checkbox element I want to send a post message to my Play Framework.</p>
<pre>﻿﻿jQuery.each($(':checkbox'), function() {
    $﻿.post('@{myPlayMethod()}', { itemValue: $(this).val() })
});﻿</pre>
<p>This code sends the html element value property to method &#8220;<em>myPlayMethod(String itemValue)</em>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/01/12/how-to-navigate-into-each-html-element-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java + Rails = Play Framework</title>
		<link>http://hugomonteiro.net/2010/01/08/java-rails-play-framework/</link>
		<comments>http://hugomonteiro.net/2010/01/08/java-rails-play-framework/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 20:40:46 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=195</guid>
		<description><![CDATA[After studying a lot of Java frameworks, I found a pretty interesting tool to develop web applications. Now you&#8217;re thinking: that framework just for run and test the application you need to configure 452 xmls and you need to configure the database, and a lot of other things&#8230; like for instance Hibernate, if you want [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="play logo" src="http://www.playframework.org/images/play.png" alt="" width="177" height="64" /></p>
<p>After studying a lot of Java frameworks, I found a pretty interesting tool to develop web applications. Now you&#8217;re thinking: that framework just for run and test the application you need to configure <em>452 xmls</em> and you need to configure the database, and a lot of other things&#8230; like for instance <a href="https://www.hibernate.org/">Hibernate</a>, if you want to get an DB object-mapper. Yes, you can have MVC, using Spring&#8230; but, you need to configure again, <em>xmls</em>. But why the hell do you need to configure xmls? I just want to focus on my programming, on the way I&#8217;m doing software.</p>
<p>After seeing rails, I became very interested in developing web applications in that way. Play Framework uses the same principle. I am doing some experiments with this new framework.</p>
<p>You already know <strong>Play Framework features</strong> (that are on their own <a href="http://www.playframework.org/">website</a>). These are the features I like more:</p>
<ul>
<li>Changing the Models at runtime (yes! You can change your database at runtime);</li>
<li>Automatic admin generation;</li>
<li>Ability to have template custom tags;</li>
<li>Integration with Hibernate (you just need to configure a text file that has your credentials to your database &#8211; <em>don&#8217;t forget the jdbc jar at playproject/lib</em>);</li>
<li>Allows you to create a netbeans or an eclipse configuration to run the project inside the IDE;</li>
<li>Support (they are always trying to help at <a href="http://groups.google.com/group/play-framework?pli=1">google groups</a> or at <a href="http://java.freenode.net//index.php?channel=playframework">irc</a>);</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2010/01/08/java-rails-play-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to divide your GUI from your processing code?</title>
		<link>http://hugomonteiro.net/2009/11/06/how-to-divide-your-gui-from-your-processing-code/</link>
		<comments>http://hugomonteiro.net/2009/11/06/how-to-divide-your-gui-from-your-processing-code/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 14:53:43 +0000</pubDate>
		<dc:creator>Hugo Monteiro</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://hugomonteiro.net/?p=157</guid>
		<description><![CDATA[Many students don't know how to organize their code. Abstractions and Interfaces makes a difference when developing Java applications. What if your code was divided? For instance, if you have created a network application with a GUI (Graphical User Interface). The first approach is to put the code all together because it's easier from the beginning. That's wrong because it's harder to find an error and you have to read a lot of garbage code like <em>textBox.setValue</em>...]]></description>
			<content:encoded><![CDATA[<p>Many students don&#8217;t know how to organize their code. Abstractions and Interfaces make a difference when developing Java applications. What if your code was divided? For instance, if you built a network application with a GUI (Graphical User Interface). The first approach is to put the code all together because it&#8217;s easier from the beginning. That&#8217;s wrong because it&#8217;s harder to find an error, and you have to read a lot of garbage code like <em>textBox.setValue</em>&#8230;</p>
<p>What about dividing this network application in two layers? One layer, with all the network code and the top layer with only the GUI? How is this possible? Using Java interfaces and the notion of events.</p>
<p>We can start by creating our event interface that will be waken up, when for instance we are receiving a message from the network:</p>
<pre>public interface EventNetworkInterface {
	void receiveMessage(String msg);
}</pre>
<p>Now it&#8217;s time to build our simplified network layer:</p>
<pre>
public class NetworkLayer {
	EventNetworkInterface gui = null;

	public NetworkLayer(EventNetworkInterface gui) {
		this.gui = gui;
	}

	public void receiveMessageNetwork() {
		//simulates receiving a message from the network
                String msg_received = "Hello World!";
		//wake up event in the GUI
		gui.receiveMessage(msg_received);
	}
}
</pre>
<p>Now with the network layer created you have to create the GUI:</p>
<pre>
public class GUI implements EventNetworkInterface {

	public static void main(String[] args) {
		new GUI();
	}

	private NetworkLayer nl;

	public GUI() {
		nl = new NetworkLayer(this);
		//issue a receiveMessage event:
		nl.receiveMessageNetwork();
	}

	@Override
	public void receiveMessage(String msg) {
		System.out.println("I sent the message: " + msg);
	}

}
</pre>
<p>In the GUI constructor we are simulating a <em>receivedMessage</em> event after we build the network layer and send the GUI that implements the events that will be waken up when a <em>receiveMessage</em> (in this case) happens.</p>
<p>With this approach you can separate the design code, from the processing code and simplify when you are adding more features to the layers beneath you.</p>
<p>If you want to have multiple classes to execute the same events, see more about the <a href="http://en.wikipedia.org/wiki/Observer_pattern">observer pattern</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hugomonteiro.net/2009/11/06/how-to-divide-your-gui-from-your-processing-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
