<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Felipe Gaucho&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/" />
<modified>2008-07-22T13:02:44Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, felipegaucho</copyright>
<entry>
<title>WADL x WSDL (article link)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/07/wadl_x_wsdl_art.html" />
<modified>2008-07-22T13:02:44Z</modified>
<issued>2008-07-22T13:02:44Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.10150</id>
<created>2008-07-22T13:02:44Z</created>
<summary type="text/plain">This blog points to a very nice article about services description languages.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>Recently I am 100% service oriented, and that's why I am a bit
absent in blogging. More than absent, I am completely focused on my <a
	href='https://cejug-classifieds.dev.java.net/'>soap experiment</a> and
I am also researching techniques on how to produce fast and reliable
web-services based on the available technologies (while overcoming
technology specific minor issues).</p>
<p>During my recent studies, I found a brilliant paper out there, it
is called <a
	href='http://download.boulder.ibm.com/ibmdl/pub/software/dw/specs/ws-wadlwsdl/WADLWSDLpaper20080621.pdf'>Definition
Languages for RESTful Web Services: WADL vs. WSDL 2.0</a>. Eventually you
already knew this one, but for me was a novelty that unveiled me the
important differences between WADL and WSDL.</p>
<p>Congratulations to the six authors of this, and I hope you also
enjoy the reading.</p>

]]>

</content>
</entry>
<entry>
<title>SOA way of life: a day in the GUI Shop</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/06/soa_way_of_life.html" />
<modified>2008-06-09T13:05:55Z</modified>
<issued>2008-06-09T11:08:12Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9941</id>
<created>2008-06-09T11:08:12Z</created>
<summary type="text/plain">I want to expose my J2EE business services through a robust and elegant
GUI. After visiting the GUI shop, I get a bit lost with so many options.
</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table><tr><td>
<p>Following my open questions series to <a href='http://jazoon.com/'>Jazoon'08</a>, I will abandon
my server roots for a moment and I will visit the the GUI programming -
a joy I usually delegate to other people but I must confess that also
has it goodies. Preparing for the conference, I am applying an extra
effort on my open source <a href='https://cejug-classifieds.dev.java.net/'>Cejug-Classifieds</a>, a J2EE application that uses
a JAXWS SOAP WebService as business facade. You can visit our home-page
to check the complete information Cejug-Classifieds, but its main
components can be illustrated in the collaboration diagram below. I have
a EJB J2EE component that encapsulates the business logic, and I have a
set of JAXWS web-services that expose the Session Facade methods of the
EJB module in format of SOAP messages. The first two components are
under development and some features can already be tested through the
available functional tests. The problem is we don't have anyone working
on the end user GUI - the web-services client - and that's why we
decided to visit a GUI Shop.</p></td><td valign='top'><a href='http://jazoon.com/en/conference/presentations.html?topic=Web_application_frameworks' border='0'><img src='http://jazoon.com/dms/jazoon08/images/swiss-duke/swiss-duke.png'/></a></td></tr></table>
<p align="middle"><img alt="collaboration.PNG" src="http://weblogs.java.net/blog/felipegaucho/archive/collaboration.PNG" width="729" height="69" /></p>

<h3>The GUI Shop</h3>
<p>Asking through mailing lists and reading Internet blogs, you can
find an uncountable options to produce the front-end of J2EE
applications, including different platforms - J2ME, J2SE and J2EE - and
different technologies and frameworks on each of these platforms. It is
hard to say at first sight what is better, so let's start creating some
criteria to evaluate our options. First of all I will reduce the scope
of my search to web technologies (Desktop and Mobile technologies
deserve another blog entries).</p>
<ol>
	<li><strong>Price</strong>: I will only check the free stuff since
	my project is open source.</li>
	<li><strong>SOAP 1.2 ready</strong>: the framework will consume
	SOAP web-services, so it is naturall to expect some built-in feature to
	communicate with soap. The minimum version that should be supported is
	1.2, but a 2.0 support is a plus.</li>
	<li><strong>Tooling</strong>: the selected technology should allow
	the automatic build of my web-application, specially using the tools I
	have at home: scripts like Ant or Maven controlled by the common IDEs
	like Eclipse and Netbeans.</li>
	<li><strong>Server friendly</strong>: the web technology should be
	easily deployed in the most common open source servers, like Tomcat,
	Glassfish and JBoss. Despite the candies offered by the server vendors,
	I don't want to be locked in a server because they convinced me about
	their fast development methodologies and proprietary frameworks.</li>
</ol>
<p>After reading a lot of propaganda about web application
development frameworks, I finished with the following candidates:</p>
<ol>
	<li><a href='http://grails.org/'>Grails</a>: a very popular
	framework supported by an enthusiastic community. The programming
	language is groovy and it gets powered with the usage of some of the
	large amount of available plugins. It works on top of Hibernate and
	Spring, so be prepared for a lot of dependencies. Best if consumed with
	Maven (IMHO). My preliminary attempts to run the helloworld proved the
	weak support of the groovy language both in Eclipse and Netbeans. I
	know there are paid plugins that can help, but to pay is not an option
	- groovy seems to follow that lemma: <em>simple things to solve
	simple problems</em>.</li>
	<li><a href='https://ajax.dev.java.net/'>jMaki</a>: <a href='http://weblogs.java.net/blog/caroljmcdonald/'>Carol McDonald</a> was also visiting the GUI Shop and brought me <a href='https://techdayscode.dev.java.net/servlets/ProjectDocumentList?folderID=9370&expandFolder=9370&folderID=0'>an impressive introduction to fast web 2.0 development</a> based on jMaki. Good option.</li>
	<li><a href='http://jruby.codehaus.org/'>JRuby</a>: after few years being
	promoted as the prospective replacement of Java, Ruby language was ported to JVM and
	for some strange reason it was not adopted as widely as we expected.
	Nevertheless, the language is available in our virtual machine and
	deserves a trial. The promise of very fast development of web
	applications is very attractive, but I want to verify what it offers
	beyond CRUD operations.</li>
	<li><a href='http://jruby.codehaus.org/'>JSF</a>: polemic
	technology since it pushes the rendering of the view layer to the
	server side. At first sight I would say it should perform worse than
	its ultra-light competitors, but due to the good examples (<a
		href='http://www.ibm.com/developerworks/edu/i-dw-r-jsfwebclient.html'>1</a>,<a
		href='http://www.oracle.com/technology/products/jdev/101/howtos/jsfws/index.html'>2</a>)
	and excellent documentation on the web, I should include JSF as one of
	my options.</li>
	<li><a href='http://www.jboss.com/products/seam'>JBoss Seam</a>: I
	included seam in my shop list because the impressive demos and natural
	integration of the seam web-applications and j2ee applications. The
	negative point seem to be a fear about the coupling between the
	framework and the JBoss server, what matches my server friendly
	constraint. I need to think better about that, because I found some
	interesting articles on the Internet showing Boss Seam running on
	Glassfish (<a
		href='http://weblogs.java.net/blog/bleonard/archive/2006/06/running_jboss_s_1.html'>1</a>,
	<a
		href='http://weblogs.java.net/blog/caroljmcdonald/archive/2007/07/sample_applicat_1.html'>2</a>).
	So, if we can have the full power of Seam without locking the
	application in the JBoss container, it is a first class option.</li>

	<li><a href='https://openjfx.dev.java.net/'>JavaFX</a>: the
	rich-client sector of the GUI Shop is full of colors and music, there
	is also a big animated banner at the corner that says <em>Applets
	are back</em>. I should confess that the idea of resurrection of my
	school-time Applets is a nice dream. So I will include JavaFX and all
	its open possibilities in my check list. FLEX would be another good
	option, if the FLEX development tools were not paid :(</li>
</ol>
<h3>Shopping Cart - Checkout</h3>
<p>Time to pick up a product and go home to try the new gift. As you
can notice above, there is no golden hammer in the web applications
market, but as any other buying stuff, you must select one. For today, I
will just enumerate my preference and discuss with my Jazoon pals about
that :) After the conference I plan to write a new blog entry with my
conclusions. If you ask me today, I would bet on JRuby, even more
because it comes with a nice free gift: <a
	href='http://www.javapassion.com/rubyonrails/'>a free online course</a>
starting on July :)</p>
<p><small><strong>Remember</strong>: <em>it is an open
discussion and not a formal product evaluation, it is based only on my
opinion and also on the discussion I read in my mailing lists. If you
remember some missed web-framework, please send to me and I will include
in the selection list</em></small>.</p>]]>

</content>
</entry>
<entry>
<title>Should I use EJB3 as web-services?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/06/should_i_use_ej.html" />
<modified>2008-06-02T12:02:03Z</modified>
<issued>2008-06-02T09:49:03Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9913</id>
<created>2008-06-02T09:49:03Z</created>
<summary type="text/plain">EJB3 makes it really easy to create web-services but sometimes I
feel unsafe to expose my business components unfiltered on the web. That
is the first of a series of open questions I plan to discuss during
Jazoon&apos;08.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table>
	<tr>
		<td valign="top">
		<p>More than a community and business event, <a
			href='http://jazoon.com/en.html'>Jazoon'08</a> offers you a chance to
		discuss technology free of pressure. You can meet the top evangelists
		and share with international developers your technical issues and
		questions - a pervasive brain storm about the Java platform. Excellent
		opportunity to validate your ideas on how to do better software - and
		if they don't survive the community's scrutiny, you can always blame
		the beers and back home with good learned lessons :).</p>
		<p>I have my own set of <a href='http://today.java.net/pub/ct/9'>(Not
		So) Stupid Questions</a>, and the first one I want to discuss with you is
		about web-services and EJB3.</p>
		</td>
		<td valign="top"><a
			href='http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishDay2008Jazoon'><img alt="glassfishday-jazoon-button160x64.png" src="http://weblogs.java.net/blog/felipegaucho/archive/glassfishday-jazoon-button160x64.png" width="160" height="64" border="0"/></a></td>
	</tr>
</table>
<h3>Is it a good design to expose EJB3 Session Facade as
web-services?</h3>
<p>Reading <a
	href='http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html'>patterns</a>
and <a href='http://www.regdeveloper.co.uk/2007/01/23/ejb_web_services/'>examples</a>
on the Internet, <a
	href='http://java.sun.com/developer/EJTechTips/2006/tt0327.html#1'>EJB3
+ @WebService</a> seem to be a fast and furious way to go straight to SOA
with few lines of code and <a href='https://glassfish.dev.java.net/'>a
good container</a>. Despite the simplicity of annotations, I
started designing an <a href='http://cejug-classifieds.dev.java.net/'>Open
Source Classifieds system</a> based on J2EE technologies and I have some
observations about that.</p>
<p>Instead of replicating here all discussions about web-services
design and its technology support, I prefer to bring you a few design
options and get your feedback live during Jazoon.</p>
<ol>
	<li>Web Client -> JAXWS SOAP web-services -> Session Facade ->
	Domain Model Facade -> @Entities</li>
	<li>Web Client -> @WebService Session Facade -> Domain Model
	Facade -> @Entities</li>
	<li>Web Client -> @WebService Session Facade -> @Entities</li>
</ol>
<p>Some considerations about the above design options:</p>
<ul>
	<li>If I use annotations, I am assuming SOAP web-services, right?
	And what about REST?</li>
	<li>If I do expose my Session Facade directly, how can I change
	later my interface from SOAP web-service to something else ?</li>
	<li>What about validation and security? My business component
	should care about data input validation and authorization and
	authentication?</li>
	<li>Load balance and orchestration. Can I use a web server (Tomcat?) to expose the service interface and a j2ee container to do the business? What about service collaboration? The session beans will have references one to each other?</li>
</ul>
<p>Using a same class to expose services interface and realizing
business use cases seems a bit overlapped to me, but eventually I am
missing some point here. It is up to you, see you in <a href='http://euro.zuerich.com/de.cfm/'>Zürich</a> :)</p>]]>

</content>
</entry>
<entry>
<title>Fishing the glass during Jazoon&apos;08</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/05/fishing_the_gla_1.html" />
<modified>2008-05-26T12:31:41Z</modified>
<issued>2008-05-26T10:57:40Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9861</id>
<created>2008-05-26T10:57:40Z</created>
<summary type="text/plain">Let&apos;s check the conference guide to see where to find a good fish
in Z&amp;#252;rich, more precisely, where are the best Jazoon&apos;08 presentations
for Glassfish users and web-service developers.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>Let's check the conference guide to see where to find a good fish
in Zürich, more precisely, where are the best <a href='http://jazoon.com/en.html'>Jazoon'08</a> presentations
for Glassfish users and web-service developers.</p>
<p>From my last conferences experience, I learned to create a
conference schedule divided in topics instead of just going there and
selecting the <em>topic of the day</em>. I first collect <a
	href='http://jazoon.com/dms/jazoon08/jazoon08-program-guide/jazoon08-program-guide.pdf'>the
list of conference's topics</a> and then I prioritize them by
day. For every day, I know the two or three presentation I must go, the
ones I want to go, and the ones I would like to go. I also include some
community slots in my schedule and, of course, some free slots - to give
me a chance to checkout something I've never heard about. It is not a
scientific method, but at least it gives me a chance to monitor my
conference day-by-day, avoiding myself of missing that fantastic session
because I was watching an impressive demo in a commercial booth :)</p>
<table><tr><td>
<img src="http://blogs.sun.com/theaquarium/resource/GlassFish-Logo-99_65px.jpg"
	foo="glassfish-icon-130_48px.png" border="0"></td><td>
<h3>Jazoon'08 Fish Menu: Glassfish and Web-Services</h3>
<p><a href='https://cejug-classifieds.dev.java.net/'>Nowadays</a> I am focused in <a
	href='http://jazoon.com/jazoon08/en/conference/presentations.html?topic=Web_services'>web-services</a>,
specially SOAP web services and Glassfish/Metro technologies, so let's
check the Jazoon'08 fish menu:</p></td></tr></table>
<ul>
	<li>
	<p><code>Monday, 2008-06-23, 09:00 - 15:00, Arena 7</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=5140'>GlassFish
	Community Day</a>: six hours fully dedicated to the latest novelties on
	Glassfish technologies. Commanded by <a href='http://blip.tv/file/931049'>Jerome Dochez</a> - the Glassfish
	architect - it is one of the unmissable sessions for any
	glassfisherman.</p>
	</li>
	<li>
	<p><code>Tuesday, 2008-06-24, 15:00 - 15:50, Arena 5</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=3482'>SAML:
	Identity Federation in Practice</a>: you know, strange fishes deserve
	precautions about how they are prepared. Security is the base of
	comfort when you try something exotic and it is even better if you know
	the cooker and from where the fished are coming from. <a
		href='http://blogs.sun.com/theaquarium/tags/saml'>Security and
	person identification</a> is a key concern in interoperability between
	web-services, and I am definitely interested about that session.</p>
	</li>
	<li>
	<p><code>Wednesday, 2008-06-25, 11:00 - 11:50, Arena 6</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=5251'>JAX-RS:
	The Java API for RESTful Web Services</a>: a small and fast fish served
	flambé, a kind of spiced web-services. If well prepared, it can offer
	you a surprisingly experience, and be aware you can eventually becomes
	addictive to it. Why not?</p>
	</li>
	<li>
	<p><code>Wednesday, 2008-06-25, 11:00 - 11:50, Arena 6</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=5251'>JAX-RS:
	The Java API for RESTful Web Services</a>: a small and fast fish served
	flambéed, a kind of spiced web-services. If well prepared, it can offer
	you a surprisingly experience, and be aware you can eventually becomes
	addictive to it. Why not?</p>
	</li>
	<li>
	<p><code>Wednesday, 2008-06-25, 14:00 - 14:50, Arena 9</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=5360'>Integration
	Profile for GlassFish v3</a>: in case you swallow a spine of fish, it is
	better to do a checkup. This session bring us a way to find out where
	are the dangerous spines of our JEE applications.</p>
	</li>
	<li>
	<p><code>Wednesday, 2008-06-25, 16:30 - 17:20, Arena 6</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=5253'>Web
	Services and Transactions</a>: a good dinner ends with bittered bill, and
	while you taste your <em>wakeup expresso</em> you should pay the bill
	and finish the transaction. This simple scenario in a restaurant
	becomes weird if you have the cooker, the waiter and the clients in
	separate rooms :).</p>
	</li>
	<li>
	<p><code>Thursday, 2008-06-26, 14:00 - 14:50, Arena 9</code></p>
	<p><a
		href='http://jazoon.com/jazoon08/en/conference/presentationdetails.html?type=sid&detail=2562'>Glassfish
	V2/V3 - the killer appserver for development and production</a>: <em>visit
	our kitchen</em> - this session introduces a guide tour to the Glassfish
	server's features. An unmissable session for a new fisherman.</p>
	</li>
</ul>
<p>It is just my Glassfish guide for Jazoon'08, I hope we can meet
there and share ideas on how to produce better web-services based on
Glassfish.</p>]]>

</content>
</entry>
<entry>
<title>Cejug-Classifieds goes Metro</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/04/cejugclassified.html" />
<modified>2008-04-04T08:41:08Z</modified>
<issued>2008-04-04T08:24:00Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9473</id>
<created>2008-04-04T08:24:00Z</created>
<summary type="text/plain">CEJUG-Classifieds is back, with reviewed goals and a new design based on the web-services stack of Metro. If you like XML and Web-Services, check the latest advertisement of our classifieds system.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table>
<tr><td>
<p>Since it was created, the cejug-classifieds project served as a proof of concept for a lot of technologies. Now it comes back with a <a href='https://metro.dev.java.net/'>new set of SOA technologies</a>.</p>
<p>I plan to post our detailed plans asap, but until I find time to create better documents, I published a collaboration diagram in the <a href='https://cejug-classifieds.dev.java.net/'>cejug-classifieds home page</a> and I also published a WAR file you can run in Glassfish for testing - the deployment descriptor included in the WAR is only ready for Glassfish, and I am looking for a volunteer to adapt it to Tomcat or JBoss :). If you prefer to inspect the code snapshot, you can checkout the <a href='https://cejug-classifieds.dev.java.net/source/browse/cejug-classifieds/'>complete source code from SVN</a>.</p>
<p>Take the subway and visit us at the Cejug-Classifieds, we are waiting for your best tips about our new plans.</p></td><td><p align="center"><a href='https://cejug-classifieds.dev.java.net/'><img alt="cejug-classifieds" src="https://cejug-classifieds.dev.java.net/images/logo.jpg" border="0" height="150" width="150"></a></p></td></tr></table>]]>

</content>
</entry>
<entry>
<title>Caravan to Jazoon&apos;08</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/03/caravana_jazoon.html" />
<modified>2008-03-12T14:00:12Z</modified>
<issued>2008-03-12T13:46:24Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9346</id>
<created>2008-03-12T13:46:24Z</created>
<summary type="text/plain">CEJUG is organizing a tech trip to Jazoon&apos;08, facilitating the information on how Brazilians can attend the Swiss conference. The good feedback suggests that the idea can be followed by other JUGs.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table><tr><td>
<p>
<a href='http://www.cejug.org/display/cejug/Home'>CEJUG</a> is organizing the <a href='http://www.cejug.org/display/cejug/Caravana+do+CEJUG+rumo+ao+Jazoon+08'>Caravan Jazoon'08</a>, a group of JUG members interested
in to participate of <a href='http://jazoon.com/'>Jazoon'08</a>. Inspired in similar initiatives by <a href='https://abaporu.dev.java.net/'>SouJava</a> and other
groups, this one has a differential: the JUG serves not only as communication channel, but also as a secure source of information about
who are attending the conference - and it is a valuable input for conference organizers.
</p>
<p>Jazoon'08 is <a href='http://jazoon.com/en/register/conferencefees.html'>open for business</a> and the goal of the conference
administrators is to give fair opportunities for everyone interested in joining the conference, including very low fares for students,
discount for JUG members and discount for groups of professionals.
One of the main issues of that flexibility is how to control <em>Who is JUG member?</em>.  Since the conference is international, it
is virtually impossible for the conference organizers to check the information provided by more than two thousand attendees.
</p></td><td><a href='http://www.cejug.org/display/cejug/Caravana+do+CEJUG+rumo+ao+Jazoon+08'><img alt="caravana.png" border="0" src="http://weblogs.java.net/blog/felipegaucho/archive/caravana.png" width="198" height="129" /></a></td></tr></table>
<h4>The social network strength of Java User Groups</h4>
<p>As a JUG leader and also as a professional, I helped Jazoon to organize its first edition in 2007. My task was
to provide information about Java community, and put the conference administrators in contact with the community
stake holders - not all of them, of course, but I guess I did a good work in helping conference and Java community
to get closer to each other. The experience provided me a good feedback on how big
conferences are organized and what are the big issues
in provide discount vouchers and free passes - basically, the lack of accurate information restricts the ability of
conference organizers of thinking about better conditions for the Java community. Jazoon has a very elegant package of
benefits for its attendees, but it causes a lot of headache for the organizers, and I can assume this is the same scenario
for JavaOne, Javapolis and any other conference with superlative numbers. The good news: JUGs can help conferences to attract
more people in a more fair way - JUGs are the local community snapshot, and they are the place you must go if you need information
about Java communities all over the world.
</p>
<h4>How Caravana Jazoon'08 works?</h4>
<p>
It is simple: we created a <a href='http://www.cejug.org/display/cejug/Caravana+do+CEJUG+rumo+ao+Jazoon+08'>home-page</a>, where we publish useful information about traveling to Switzerland, and we also
publish the pictures and names of the confirmed attendees. This way, we can identify ourselves, exchange traveling tips
and - the most important - guarantee for the conference organizers clear and trustful information about who is asking discount vouchers.
</p>
<p>
It is our first travel initiative, but we plan to extend it to JavaOne and others. If our group of interested travelers
grows up enough, we can start to negotiate with conference organizers, tourism agencies, etc.
</p>
<p><small>
* <a href='http://en.wikipedia.org/w/index.php?title=Caravan_%28travellers%29&redirect=no'>Caravan </a> @ wikipedia</small></p>]]>

</content>
</entry>
<entry>
<title>Is software beyond hardware?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/02/is_software_bey.html" />
<modified>2008-02-06T20:21:24Z</modified>
<issued>2008-02-06T20:14:34Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9151</id>
<created>2008-02-06T20:14:34Z</created>
<summary type="text/plain">A fun discussion today about the elderly hardware we continue to use in our day by day, like keyboards and mouses. Don&apos;t you think these devices are evolving slower than our software expectations? </summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Mobility</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table>
	<tr>
		<td valign='top'>
		<p>The discussion started in my <a href='http://www.cejug.org/display/cejug/Home'>JUG mailing list</a>, where some
		members started celebrating the availability of <a
			href='http://br.youtube.com/yt_mobile_app'>YouTube for Mobile
		Devices</a>, including remarkable advances of the nowadays gadgets, like
		the <em>supposedly revolutionary</em> features of IPhone and a lot of
		other technologies.</p>

		<p>The aftermath of the flame produced some insights I would like
		to share with you, but not before a context quiz:</p>
		<ol>
			<li>When the keyboard was invented?</li>
			<li>When the mouse was invented?</li>
			<li>How frequently you run applications in your cell phone? If
			not much, why?</li>
			<li>How many pages you can type in a small device before to hit
			it in the wall?</li>
			<li>How many hours - compared to your TV or your computer - you
			spend using your mobile devices? If not much, why?</li>
			<li>Which is more expensive in your working place: your computer
			or your chair?</li>
			<li>When was the last time you updated or replaced a software?</li>
			<li>When was the last time you updated or replaced a hardware?</li>
			<li>Pervasive computing means you to carry everything in your
			pocket? If not, why you still carrying it?</li>
		</ol>
		<p>So, if you start looking around and thinking of what your are
		using, perhaps you share my perception about the gap between hardware
		and software. Few more thoughts and you realize the different velocity
		some technologies are adopted comparing to others, and the obvious
		commercial side-effects.</p>
		<p>One of the key points of our discussion was about powerful
		tools of mobile devices and the real adoption of such features. No
		doubt modern cell phones can seduce you with those colored keys,
		multimedia features and fancy design... but think twice, how
		frequently you actually use it for something you really need?</p>
		<h4>The hardware hurts you</h4>
		<p>A short survey gave us the impression about the most popular
		features of mobile devices: SMS, GPS and - of course - the phone. We
		could not identify the adoption of anything much beyond those basic
		functionalities. Despite all arguments used to justify why the
		revolutionary features are not being adopted in large scale by end
		user, I have a strong feeling about the main reason: the hardware is
		just boring. The hardware hurts you, it destroys your body and your
		patience, and doesn't matter your expectations about the next cell
		phone xyz99, it will come with a newer version of the same too small
		buttons, tiring screen and probably it will be just a replacement of
		your current walkman. Keyboards? Come on, when was the last time you
		invest real money in a keyboard? <em>Cheapest</em> seems to be the
		most successfully brand in the keyboards market. Mouse? Do you really
		like it? And what about the furniture? Do you really believe the
		designer/architect who designed your chair spends 12 hours coding
		every day? eheh, I guess not, the artistic designer is probably more
		busy thinking about colors and other very important details. Important
		for sale, I guess :)</p>
		<h4>Innovation == renovation?</h4>
		<p>Thinking about the last 30 years (sorry, more than that I
		should be born again), I can remember real revolutions in movies,
		image, sound, software. From computer technology, hardware evolved a
		lot, including astronomical amount of memory we use nowadays and the
		allucinogenous CPU velocity. But about design, it is a bit hard to
		defend. While we wait for the Quantum Physics to offer us another
		computer model, we seem to be locked in old paradigms. I would like
		not to go so far in science because it is just a blog, but returning
		to the subject of our mundane gadgets I guess we are waiting too long
		for better devices, aren't we?</p>
		<p>I must confess the discussion was quite interesting and I
		pretty sure about its controversial side-effects, but instead of
		bothering you more about my insights, I prefer to leave these ideas
		open for discussion. Perhaps you can show me other perspective,
		something to convince me to give a second chance to try the cell
		phone.</p>
		<h4>A wish for my next cell phone</h4>
		<p>I want my cell phone to read my email messages for me, and I
		want to have a chance to speak the responses or new messages while the
		phone converts the sound in text messages.</p>
		<p>It seems better than another five different ways to manipulate
		the renewed versions of the same icons through the same buttons :)</p>
		</td>
		<td>
		<table>
			<tr>
				<td style='background: grey; font-weight: bold;' align='center'>
				<small>Pictures copied from <a
					href='http://en.wikipedia.org/wiki/Main_Page'>Wikipedia</a> for
				non-commercial purposes ;)</small></td>
			</tr>
			<tr>
				<td><img alt="mouse.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/mouse.jpg" width="180" height="158" title="Technology from 1980"/><img alt="phone.png" src="http://weblogs.java.net/blog/felipegaucho/archive/phone.png" width="180" height="80" title="Researched since 1908, the mobile phone become popular after 1980"/>
					</td>
			</tr>
			<tr>
				<td><img alt="typewriter.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/typewriter.jpg" width="250" height="188" title="Technology from 1714 - is it so different from your keyboard?"/><img alt="touch.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/touch.jpg" width="180" height="272" title="Touch screen is from 1983"/></td>
			</tr>
			<tr>
				<td><img alt="software.png" src="http://weblogs.java.net/blog/felipegaucho/archive/software.png" width="292" height="218" title="What is the oldest software are you running now?"/></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
]]>

</content>
</entry>
<entry>
<title>Netbeans &amp; Eclipse - confluence is possible</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/02/netbeans_eclips.html" />
<modified>2008-02-03T19:09:37Z</modified>
<issued>2008-02-03T18:22:30Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9123</id>
<created>2008-02-03T18:22:30Z</created>
<summary type="text/plain">Java Projects can be developed on both IDEs without any
modification. This blog entry shows how a good configuration can provide
your developers a much more comfortable and productive environment than
exposing them to exogenous tools.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community: NetBeans</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>Trying <a
	href='http://bits.netbeans.org/netbeans/6.1/m1/2008-01-28_10-31-18/'>NetBeans
6.1</a> I got Eclipse and NetBeans ready for my collaborators in a
transparent way. Actually I started the <a
	href='https://footprint.dev.java.net/'>Footprint Project</a> few months
ago with NetBeans, and later I also started using Eclipse to maintain
its contents because I use different environments in my daylight job and in
my Open Source activities.</p>
		<p>After few trials, I was forced to abandon NetBeans due to
		the absence of support for JUnit 4.1, but after the release of the newest
		NetBeans, I got JUnit and several other interesting <a
			href='http://www.javalobby.org/java/forums/t104052.html'>features</a>
		that put me back on track about offering the community  a more
		comfortable development environment. Today, you can <a
			href='https://footprint.dev.java.net/source/browse/footprint/'>checkout
		Footprint Project</a> both in Eclipse and NetBeans IDE without loss of
		productivity or any need of special configuration tricks.</p>
<table>
	<tr>
		<td>
		<h4>And what about configuration files?</h4>
		<p>The configuration files of both platforms are committed under
		version control and I noticed they are ignored by the other platform.
		Eclipse shows an alert in the problems list, and the internal
		file used by NetBeans for automatic updating of ANT tasks is also
		marked as problem, but it has no impact on the development environment
		and the project normally compiles, runs and executes tests  in both IDEs.</p>		<h4>What is the big deal on using two IDEs in a same project?</h4>
		<p>In commercial projects, probably the best strategy is to bet in
		a unique platform and find a way to extract the best that IDE can give
		you, eventually including some platform specific tricks in your
		configuration to enhance your productivity. But technology is not
		static and sometimes it is nice to keep an open mind about what is
		going on in the open source community. I will not promote here another
		tiring comparison of IDE flame, we have enough of that in every Java
		mailing list, but I'd rather to post some positive thoughts from
		my personal experience:</p>
		<p><strong>NetBeans</strong> offers automatic updating of ANT tasks
		if you change artifacts and/or structure of your project. For example,
		if you include a new folder, NetBeans add its reference in your
		ANT tasks definition. The Sun IDE also offers an impressive i18n
		support with features to refactor old projects in order to verify
		missed constants.</p>
		<p>On the other side, <strong>Eclipse</strong> is still the most
		comfortable Java editor available, fast and reliable.</p>
<p>Both IDEs offer a very good Subversion support and the most
common development features without great differences - despite personal
opinions, of course ;)</p>
<p>That's it for now, I am very happy with the recent advances of
NetBeans IDE and I am for a long time fan of Eclipse, so what I suggest you to
do is to try both IDEs and find out what best fits your project
requirements. Afterwards, the best comparison available continues to be
your own experience.</p>
		</td>
		<td><img alt="confluence.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/confluence.jpg" width="603" height="496" /></td>
	</tr>
</table>
]]>

</content>
</entry>
<entry>
<title>PUJ - Code Competition for University Students</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2008/01/puj_code_compet.html" />
<modified>2008-01-28T09:40:54Z</modified>
<issued>2008-01-28T06:16:34Z</issued>
<id>tag:weblogs.java.net,2008:/blog/felipegaucho/287.9073</id>
<created>2008-01-28T06:16:34Z</created>
<summary type="text/plain">PUJ is a new competition format that allows companies to
acknowledge the best Java codes produced by students during an academic
semester. Check out the competition rules created by CEJUG to promote
the synergy between IT market and universities - including preliminary
results.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community: Global Education and Learning Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>PUJ is a new competition format that allows companies to
acknowledge the best Java codes produced by students during an academic
semester. Check out the competition rules created by CEJUG to promote
the synergy between IT market and universities - including preliminary
results.</p>
<h4>PUJ - a code competition template</h4>
<p>In <a
	href='https://cejug.dev.java.net/files/documents/859/83683/puj_en_US.pdf'>this
link you can find the translated rules of <strong>PUJ</strong> (<small>Prêmio
Universitário Java</small>)</a>, a competition organized by CEJUG at the end of
2007. The competition inspiration states as:
<pre>
	To offer the local market a chance to evaluate what is produced	in Java classes
	of universities, allowing companies and universities to share the same goal of 
	helping people and market to become more productive.
</pre>
</p>
<p>The idea is to promote the collaboration between local people
toward a better society, identifying shared values in all layers of the
IT productivity chain, including students, teachers and professionals.
Apparently obvious at first sight, this idea proved not so simple to be
implemented in the real world. CEJUG held the first edition of PUJ at
the end of 2007, and some very interesting feedback was collected. Some
of those experiences, including the polemic points are discussed below.








</p>
<ol>
	<li>
	<h4>Can I reuse the PUJ format in my local JUG or company?</h4>
	<p><strong>Please copy the PUJ idea</strong>, be my guest to reuse
	the proposed rules. PUJ was invented to help people to promote Java and
	to unify Java people around the idea of quality software development.
	The competition format and its former ideas are not new, and you
	probably can enumerate a large set of similar initiatives, but PUJ is
	distributed without authorship in a hope to be adopted by the largest number of people. If you have a JUG, please do your own PUJ - you can
	change the name, and if you like it we only ask you to quote CEJUG
	somewhere ;)</p>
	</li>
	<li>
	<h4>Everyone is responsible by the quality of the education
	process.</h4>
	<p>A beautiful side-effect of PUJ is to distribute the idea quality
	on all partners of the educational process: students, professors and
	companies. When a teacher knows his class statements will go public, he
	becomes naturally concerned about the quality of the statements. Other
	good side-effect is the comparison between several statements done by
	students and the market professionals, avoiding bad teachers to
	continue to destroy the future of the young talents. Basic posting: bad
	professionals, bad teachers and bad students do not find space to hide
	under PUJ - I invite you to think about that.</p>
	</li>
	<li>
	<h4>What kind of statement is used in PUJ?</h4>
	<p>All kind of statement, the submissions of PUJ should include
	works already done - the competition itself does not provide any
	statement. The goal of PUJ is to ask IT professionals to evaluate what
	is being produced inside classrooms, and it does not make sense to
	restrict or to force a specific type of work to be evaluated. Advanced
	mathematics and tic-tac-toe programs are supposed to be eligible to
	participate in the same level. Apparently unfair, we detected some
	interesting points about that:</p>
	<ul>
		<li>
		<p>The number of submitted works was much lower than we expected.
		It unveiled a simple fact that <strong>graduation students
		are not producing much Java code or they are producing low quality
		works</strong>. We didn't received the advanced mathematics works as well we
		didn't received the tic-tac-toe ones :) The small number of submission
		suggests us to promote PUJ and forces the universities to explain why
		their students are not competing - since the universities are always
		doing marketing about their high-quality classes, where is this
		quality?</p>
		</li>
		<li>
		<p>The local universities share a very similar curriculum. The
		subjects and type of works are the same. Part of this similarity comes
		from the government regulation of education, and part comes from the
		lack of creativity of the teachers, who prefer to copy the old
		statements instead of adapting it to their pupils reality.</p>
		</li>
		<li>The code of students from different universities was much
		less different than we expected. In a first moment, the famous
		universities were considered virtual champions and we expected their
		students will annihilate the other ones by superior education. The
		reality exposed a close ability between students from several
		different universities. We don't have a stable opinion about the
		causes, but we believe it is due to the fact that academic recognition
		comes from scientific research and not from technical education.</li>
	</ul>
	</li>
	<li>
	<h4>What are the evaluation criteria?</h4>
	<p>This is a recurrent question, and it seems locked in the
	traditional programming competition formats, where the rules are
	settled as static criteria from a point of view of a unique company or
	group of persons. In the real world, the idea of quality is not limited
	to a tabular enumeration of criteria, and the common sense about <em>what
	is good or not</em> seems to be more a natural perception about quality than
	cold numbers or technical arguments. The only criterion suggested by
	PUJ to the evaluators was: <strong>Classify the quality of the
	students work using your own point of view</strong>.</p>
	</li>
	<li>
	<h4>Does it make sense to allow people to judge something without
	establishing clear rules on how to do that?</h4>
	<p>Simple answer: YES, it makes absolute sense to ask people about
	the quality of something even if we know some of them may not have solid
	background to understand or even classify it - because this is what
	happens in the real world. <em>How many times did you notice that
	amazing idea failing as commercial product</em>?</p>
	<p>In case of PUJ, it is even more fair because the evaluators are
	participating in the competition themselves - students, teachers and IT
	professionals looking for a shared mind about what is being produced
	inside classrooms. The trick to minimize deviations is to consider the
	different level of maturity of the participants - we adopted weights
	based on the role each evaluator play in the local market: students
	opinion is weaker than senior professionals opinion, but all opinions
	are contributing to the final grade of the works. The more people you
	include in this peer-review process the more fair it becomes. In the
	first edition of PUJ, we defined the following opinion weights:</p>
	<ul>
		<li>IT professionals: grade <strong>x 7</strong></li>
		<li>Instructors: grade <strong>x 4</strong></li>
		<li>Students: grade <strong>x 1</strong></li>
	</ul>
	</li>
	<li>
	<h4>Why not to use technologies categories?</h4>
	<p>This is an open decision, and in the first edition of the prize
	we asked people to focus more on the quality of the implemented
	solution than in its underneath technologies. We believe it reflects
	the IT market, because no client ask you to do a software with
	technology A or B, clients are looking for solutions to their problems.
	One nice side-effect of the first edition of PUJ was to discuss the
	epistemic view of the novice developers: <strong>Students tend
	to focus on technologies instead of focus on the solution of problems</strong>.</p>
	<p>To contribute to dismiss this problem, <strong>PUJ
	asked the students to compete in the same arena with their preferred
	weapons</strong> ;). The first reaction to this idea was a lot of questions like
	<em>How can I apply my Swing application against the other
	student's Ajax application </em>? This reflected the students' fetish about
	hype technologies instead of the quality of solutions. Students tend to
	classify something better even before to look at it, just because they know
	certain technology was used - and it is nocive to their own carriers.
	The goal here is to put experimented professionals and students
	evaluating the same code and to give the students a chance to think
	about <em>why some works are better than others even using a
	supposedly worse technology</em>?</p>
	<p>Special remark: it worked fine in the first edition and the
	controversial discussion about that continue to echo in our JUG lists.
	We believe this was one of the best contribution of PUJ to the
	approximation of academic reality to the local market expectations. <strong>The
	PUJ competition does not aim to evaluate technologies</strong>, the goal is to
	evaluate the quality of students' works - in a perfect scenario, people
	learn how to think about the problems and their solutions instead of
	trying to force the adaptation of the problems to their preferred
	technologies. Of course the grades were contaminated with the hype but
	we believe with time this strategy will help to reduce the gap between
	classrooms and development centers.</p>
	</li>
</ol>
<h4>And the winner is...</h4>
<p>First edition of PUJ was experimental, but proved its values with
some good competitors, besides going under the spotlight of Ceará IT market. The
local results are more important in local community, but I would like to
use this space to honor the great winner of the 1st PUJ: Alexandre
Pinheiro e Silva, student of <a href='http://www.unifor.br/'>UNIFOR
University</a>. He produced a work titled "Virtual Video Rental Store", a
web application using Struts and EJB3 technologies. The second place was
granted to Francisco de Assis Ribeiro Junior, student of <a
	href='http://www.fic.br/v4/index.shtml'>FIC Faculty</a>. He produced a
work about process communication, a Peer to Peer application based on
Sockets. Both works with source code and comments (<small>only
in Portugese</small>) are available <a
	href='https://cejug.dev.java.net/servlets/ProjectDocumentList?folderID=8600&expandFolder=8600&folderID=7024'>here</a>.</p>
<table>
	<tr>
		<td><p><strong>Alexandre Pinheiro e Silva</strong>, winner of the
		1st PUJ CEJUG - 2007/02 - Fortaleza / CE - Brazil:<br />
		<br />
		... I am very happy to be the first winner of PUJ, quite a surprise
		because I produced the code thinking only about my class requirements
		- I never thought it would be part of a code competition. One of the best
		feedback from PUJ were the comments of the evaluators, where senior
		professionals pointed some good features and also the weak part of my
		work. Following their suggestion I believe I can get better in my code
		style and overall quality in software development. I plan to
		participate in the next editions of the prize, it will depend only on
		what the teacher will ask me in the next classes...</p></td>
		<td><p><img alt="ap.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/ap.jpg" width="224" height="166" /></p></td>
	</tr>
</table>
<p>That's it, we confirmed the second edition of PUJ to the first
semester of 2008, and we expect to evolve from the original model to
something that can help universities and companies to establish their
shared values. We believe one of the prime goals of a JUG is to promote
Java, and to put students to compete is a good action in this sense.</p>
<p>If you have ideas on how to improve the PUJ format, or if you
identify problems in our rules, please comment in the form below.</p>
]]>

</content>
</entry>
<entry>
<title>Happy New Year Java Community</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/12/happy_new_year_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-12-31T17:39:01Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8902</id>
<created>2007-12-31T17:39:01Z</created>
<summary type="text/plain">Just to say a big thanks for all of you, my Java friends that filled 2007 with technology.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>
2007 was an exciting Java year, and I am sure 2008 will raise with a better life and great success for all Java community. Enjoy your time, stay with your family and friends, and keep your hands off the keyboard for tonight :)</p>
<h3>HAPPY NEW YEAR, WELCOME JAVA 2008</h3>
<applet
	codebase = "java/"
	archive  = "http://weblogs.java.net/blog/felipegaucho/archive/jadc.jar"
	code     = "com.tecnick.jadc.Jadc.class"
	name     = "jadc"
	id       = "jadc"
	alt      = "JADC example"
	width    = "552"
	height   = "315"
	hspace   = "0"
	vspace   = "0"
	align    = "top"
>
 <param name="counter_mode" value="true">
 <param name="local_time" value="true">
 <param name="timezone_hours" value="0">
 <param name="timezone_minutes" value="0">
 <param name="display_pattern" value="dddd HH:mm:ss">
 <param name="input_pattern" value="yyyy-MM-dd HH:mm:ss">
 <param name="counter_time" value="2008-01-01 00:00:00">
 <param name="background_color" value="FFFFFF">
 <param name="background_image" value="http://weblogs.java.net/blog/felipegaucho/archive/gosling.jpg">
<param name="img_0" value="http://weblogs.java.net/blog/felipegaucho/archive/0.gif" />
<param name="img_1" value="http://weblogs.java.net/blog/felipegaucho/archive/1.gif" />
<param name="img_2" value="http://weblogs.java.net/blog/felipegaucho/archive/2.gif" />
<param name="img_3" value="http://weblogs.java.net/blog/felipegaucho/archive/3.gif" />
<param name="img_4" value="http://weblogs.java.net/blog/felipegaucho/archive/4.gif" />
<param name="img_5" value="http://weblogs.java.net/blog/felipegaucho/archive/5.gif" />
<param name="img_6" value="http://weblogs.java.net/blog/felipegaucho/archive/6.gif" />
<param name="img_7" value="http://weblogs.java.net/blog/felipegaucho/archive/7.gif" />
<param name="img_8" value="http://weblogs.java.net/blog/felipegaucho/archive/8.gif" />
<param name="img_9" value="http://weblogs.java.net/blog/felipegaucho/archive/9.gif" />
<param name="img_sep" value="http://weblogs.java.net/blog/felipegaucho/archive/sep.gif" />
<param name="img_dec" value="http://weblogs.java.net/blog/felipegaucho/archive/dec.gif" />
<param name="img_blk" value="http://weblogs.java.net/blog/felipegaucho/archive/blk.gif" />
<param name="img_pos" value="http://weblogs.java.net/blog/felipegaucho/archive/pos.gif" />
<param name="img_neg" value="http://weblogs.java.net/blog/felipegaucho/archive/neg.gif" />
 </applet>


]]>

</content>
</entry>
<entry>
<title>Jazoon&apos;08 Call for papers</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/12/jazoon08_call_f.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-12-16T18:05:46Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8838</id>
<created>2007-12-16T18:05:46Z</created>
<summary type="text/plain">You can submit your abstract for Jazoon&apos;08 until 31 of December 2007. Hurry up, there is still some time to expose your project to all Europe.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>I am a bit busy these days, but I am planning to return my blog activities in 2008. This blog is just to remind you about Jazoon call for papers. Several big players are already confirmed to the second edition of the conference in Zürich, Switzerland, and this year we will have a special attraction related to the Euro 2008. If you like Java and eventually football, you cannot miss it :)
</p>
<h3><a href='http://jazoon.com/en/contribute/cfp.html'>Click here to check the conference page</a></h3>
<p>The Jazoon'08 conference invites you to share your experience and knowledge in the following categories: <ul>     <li>Technical short talks (20' incl. Q&amp;A) within the technical program<br />     (Submission deadline 2007-12-31)</li>     <li>Technical long talks (50' incl. Q&amp;A) within the technical program<br />     (Submission deadline 2007-12-31)</li>     <li>Jazoon Labs (2 consecutive slots of 50' with a break of 10' in between)<br />     (Submission deadline 2007-12-31)</li>     <li>Birds-of-a-feather sessions (90')<br />     (Online Submission deadline 2008-06-15)</li> </ul> <p> All abstracts have to be submitted in English using the <a href="../../en/contribute/submission.html">submission forms</a>. </p> ]]>

</content>
</entry>
<entry>
<title>Simple example of Dependency Injection</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/11/simple_example_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-11-06T18:41:28Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8587</id>
<created>2007-11-06T18:41:28Z</created>
<summary type="text/plain">A code sample on how to use Dependency Injection to modify the format and/or the way Footprint publishes PDF documents.
</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Patterns</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>
<a href='https://footprint.dev.java.net/'>Footprint Project</a> is gaining momentum since its stable release, with a growing number of JUGs and other
groups using the library to produce signed certificates for events and courses.
Some of these early adopters are asking me how to modify the way Footprint publish the certificates,
and also if there is a set of configuration they can use in order to avoid checkout the project from
the SVN repository and do it programmatically.</p>
<p>
Well, you actually cannot escape from programming, but instead of digging details
of the Footprint library, you can use Dependency Injection to minimize your effort.
</p>
<h4>How Footprint publishes the signed PDF files?</h4>
<p>
First of all, a brief explanation on how Footprint generates documents - shown in the diagram below:
</p>
<p align='center'>
<img alt="ioc1.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/ioc1.jpg" width="783" height="281" /></p>
<table width='100%'><tr><td>
<p>
The documents are generated by two classes:
<ol><li>An <a href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/exporter/Exporter.java?rev=250&view=log'>Exporter</a>, responsible for generating the document in the file system.</li><li>
A <a href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/publisher/FootprintPublisher.java?rev=116&view=log'>Publisher</a>, responsible to access the data source and guarantee the generation of a document for each entry.
</li></ol>
<p>
The stable release of Footprint
provides default implementations for these interfaces:
<ul>
<li><a href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/exporter/pdf/SignedPdfExporter.java?rev=270&view=log'>net.java.dev.footprint.exporter.pdf.SignedPdfExporter</a> - a code based on iText that reads a PDF template,
fill its form values and sign with a digital certificate.</li>
<li><a href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/publisher/JdbcPublisher.java?rev=270&view=log'>net.java.dev.footprint.publisher.JdbcPublisher</a> - a publisher based on JDBC connections.</li>
</ul>
</p></td><td><table border='1'>
<tr><th>Code sample: <small>That's all you need to generate certificates.</small></th></tr>
<tr><td><p><code>
Logger logger = FootprintDefaults.getDefaultFootprintLogger();<br>
FootprintProperties config = loadConfig(...);<br>
try {<br>
&nbsp;&nbsp;&nbsp; Exporter jdbcExporter =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PdfExporterFactory.getPdfExporter(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exporter.DEFAULT_SIGNED_PDF_EXPORTER, config);<br>
&nbsp;&nbsp;&nbsp; FootprintPublisher publisher = new JdbcPublisher(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 	jdbcExporter, config, logger);<br>
&nbsp;&nbsp;&nbsp; Thread service = new Thread(publisher);<br>
&nbsp;&nbsp;&nbsp; service.start();<br>
&nbsp;&nbsp;&nbsp; while (service.isAlive()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.sleep(200);<br>
&nbsp;&nbsp;&nbsp; }<br>
} catch (Exception e) {<br>
&nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
}
</code></p></td></tr></table>
</td></table>
<h4>Using Constructor Injection to modify the behavior of the Exporter</h4>
<p>The core interface of Footprint is the <a href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/exporter/Exporter.java?rev=250&view=log'>Exporter</a>, which describe the following set of methods:
</p><p><pre><code>	package net.java.dev.footprint.exporter;
	public interface Exporter {
		String <font color='darkblue'>DEFAULT_SIGNED_PDF_EXPORTER</font> = "net.java.dev.footprint.exporter.pdf.SignedPdfExporter";
		String export(File outputFolder) throws Exception;
		String export(File outputFolder, Map<string, string=""> fields) throws Exception;
		String export(String filename, Map<string, string=""> fields) throws Exception;
	}
</code></pre></p>
<p>Following the <a href='http://martinfowler.com/articles/injection.html'>Dependency Injection pattern</a> proposed by Martin Fowler, the Footprint
uses Construction Injection to allow different implementations  of the Exporter interface. In order to produce different documents - other than signed PDF files - or to change the way the documents are generated, you must do:</p>
<ol>
<li>Create a class that realize the Exporter interface:</li>
<code>public class <strong>MyRtfExporter</strong> implements net.java.dev.footprint.exporter.Exporter</code></li>
<li>Pass an instance of this class to the constructor of the publisher:</li>
<code>FootprintPublisher rtfPublisher = new JdbcPublisher(new <strong>MyRtfExporter</strong>(), <em>config</em>, <em>logger</em>);</code></ol>
<p></p>
<p align='center'>
<img src='ioc3.jpg'></p>
<p>That's it. Dependency Injection is an overhyped term used to promote the idea of an advanced usage of Design Patterns, but simply posting: <em>dependency injection is a realization of an interface passed as parameter of a constructor or a method.</em>. The so called inversion of control means you are creating a program based on abstract concepts - the interfaces - but the concrete way your program will produce its results will come from outside the code: it will be <em>injected</em>. <strong>Your code will not control the way the interfaces will be realized, the user of your code will do that</strong> ;)
</p>
<p>Final tips:<ul><li>Footprint uses reflection to load the instances of the injected implementations.</li>
<li>Don't forgett to include your custom implementations of Exporter in the same classpath of the footprint-core.jar.</li>
<li>Footprint Project is licensed under LGPL, and the full source code is available at the <a href='https://footprint.dev.java.net/source/browse/footprint/'>SVN repository</a>.</li>
</ul></p>]]>

</content>
</entry>
<entry>
<title>Loading Properties from XML (revisited)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/10/loading_propert.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-10-29T20:23:54Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8513</id>
<created>2007-10-29T20:23:54Z</created>
<summary type="text/plain">A comparison sheet between using JAXB for loading properties instead of using java.util.Properties.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>My <a href='http://weblogs.java.net/blog/felipegaucho/archive/2007/10/configuration_o.html'>last
blog</a> about using JAXB instead of Properties for loading configuration of
Java applications was a bit verbose - so, I decided to print a summary
in order to facilitate the comprehension about the original proposal. I
will not expose the discussion again, just present the below comparison
sheet:</p>
<p>
<table border='1'>
	<tr bgcolor='lightgray'>
		<th>java.util.Properties</th>
		<th>JAXB</th>
	</tr>
	<tr>
		<td colspan='2'><i>The configuration files:</i></td>
	</tr>
	<tr>
		<td valign='top'><pre>text=word
primitive=2
anobj.name=test
anobj.integer=3</pre></td>
		<td>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;<br>
		&lt;myConfig <code>text</code>="<code>word</code>" <code>primitive</code>="<code>2</code>"
		&gt;<br>
		&nbsp;&nbsp;&nbsp;&lt;my.obj name="<code>test</code>" integer="<code>3</code>"/&gt;<br>
		&lt;/myConfig&gt;<br>
		</td>
	</tr>
	<tr>
		<td colspan='2'><i>The code required for loading the
		configuration in the memory:</i></td>
	</tr>
	<tr>
		<td valign='top'><pre>// Read properties file.
Properties <strong>properties</strong> = new Properties();
properties.load(new FileInputStream("<font color='blue'>filename.properties</font>"));
</pre></td>
		<td><pre>
// Unmarshal the properties XML file into a Java Object
JAXBContext jc = JAXBContext.newInstance(
		AbstractJaxbFootprintStream.FOOTPRINT_CONTEXT, this.getClass()
				.getClassLoader());

Unmarshaller unmarshaller = jc.createUnmarshaller();
unmarshaller.setEventHandler(new FootprintConfigValidationHandler());
unmarshaller.setListener(listener);
SchemaFactory sf = SchemaFactory
		.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = sf.newSchema(getClass().getClassLoader().getResource(
		"<font color='blue'>config.xsd</font>"));
unmarshaller.setSchema(schema);

MyConfig <strong>properties</strong> = (JAXBElement) unmarshaller
		.unmarshal(new FileInputStream("<font color='blue'>filename.xml</font>")).getValue();
</pre></td>
	</tr>
	<tr>
		<td colspan='2'><i>Reading the configuration values:</i></td>
	</tr>
	<tr valign='top'>
		<td><pre>// A String:
String text = properties.getProperties("<font color='red'>text</font>");

// Other primitive values:
int number = Integer.parseInt(properties.getProperties("<font
			color='red'>primitive</font>"));

// An object:
String name = properties.getProperties("<font color='red'>anobject.name</font>");
int integer = properties.getProperties("<font color='red'>anobject.integer</font>");
Object yourObj = new YourObj(name, integer);</pre></td>
		<td><pre>// A String: 
String text = properties.getText();

// Other primitive values:
int number = properties.getPrimitive();

// An object: 
Object yourObj = properties.getMyObject();</pre></td>
	</tr>

	<tr>
		<td colspan='2'><i>My arguments for adopting JAXB instead of
		java.util.Properties:</i></td>
	</tr>
	<tr valign='top'>
		<td>
		<ul>
			<li>The <font color='red'>red text</font> are hard-codes
			occurrences. Even if you create constants, you continue with the
			issue to remembers its names, and if you commit a typo or other minor
			mistake, nor the IDE neither the compiler will help you to avoid
			problems under production.<br>
			</li>
			<li>Other issue is about creating complex types: you are
			responsible for converting the key/values pairs in Java Objects in
			case of complex types. You need to check if the attributes required
			for creating the object are present and also its types and/or if the
			value associated to the key is not null.</li>
			<li>Property files cannot be checked against its syntax or
			contents, since it is just a plain text file.</li>
			<li>Complex types should be simulated by a set of key/value
			pairs and later converted in a <em>non-bullet-proof</em> code.</li>
			<li>If the application requires different set of properties, it
			should rely on several different files. These files are independent
			and you must create a custom code to manage it in your application.</li>
		</ul>
		</td>
		<td>
		<ul>
			<li>No hard-codes, you don't need to check which string map to a
			certain object.</li>
			<li>No types conversion by code - the methods you use to
			retrieve the values from the Configuration Object are defined with
			the correct type.</li>
			<li>There is no risk of deploying typos or minor mistakes since
			the compiler and the IDE will notify your mstakes on the fly.</li>
			<li>XML Property files can be verified against its Schema
			definition.</li>
			<li>Support for complex types.</li>
			<li>Different set of properties can be modeled in a unique file,
			using nested elements. Even if you need to use different XML
			properties files, you can import files in a master definition,
			creating a formal relationship between them.</li>
		</ul>
		</td>
	</tr>
</table>
</p>
<p>
<small>*<em> The title of this blog is an intentional
reference to this <a href='http://www.ibm.com/developerworks/java/library/j-tiger02254.html'>4
years old article</a></em>.</small></p>]]>

</content>
</entry>
<entry>
<title>Configuration Objects: using JAXB instead of java.util.Properties</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/10/configuration_o.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-10-26T11:11:01Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8498</id>
<created>2007-10-26T11:11:01Z</created>
<summary type="text/plain">A real world example where JAXB provides a better
solution for loading configuration files than using
java.util.Properties. It includes a discussion about the benefits and
drawbacks on binding a XML file to a Configuration Object,
instead of just load key/value pairs of Strings.</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<p>Configurable features is a common requisite of computer systems,
and the Java API provides the utility class <code>java.util.Properties</code>
to facilitate our lives. It is very simple to use, and it is suitable
for the most part of applications, but it also has some limitations -
more precisely when we consider the configuration data:</p>
<ol>
	<li>How to check if all key/values are really present in the
	properties file?</li>
	<li>How to check if the type of the values are consistent with the
	types required by the application?</li>
	<li>How to represent complex types (nested properties)? For
	example: I have a property that is a set of properties.</li>
	<li>How to represent values that are not Java primitive types?</li>
</ol>
<p>Special remind: properties loading using the java API just reads
the key/values pair in the memory , it doesn't check its consistency or
any data structure related to the configuration. And more: unfortunately
the Properties class is locked in the old Properties DTD and it doesn't
support nested structures or complex types. It also provides a XML
validation mechanism, but it is really too simple to be useful in more
complex scenarios - like the one I present below.</p>
<h4>A real world example where <code>java.util.Properties</code>
seems not to be enough</h4>
<p>My need for a better Properties loading mechanism started when I
coded the <a href='https://footprint.dev.java.net/'>Footprint
project</a> - Footprint is a signed PDF generator that requires three
distinct set of Properties:</p>
<ol>
	<li>The JDBC Driver Properties: required by <a
		href='http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DriverManager.html#getConnection(java.lang.String,%20java.util.Properties)'><code>java.sql.DriverManager#getConnection</code></a></li>
	<li>A mapping between the name of the fields in the PDF template
	and the name of the column names in the database.</li>
	<li>The general properties used to configure the system (number of
	threads, resources directories, etc.).</li>
</ol>
<p>My prime code was based on three different files, and I also
thought of creating a unique properties file referring the other ones or
adopting some pre-defined prefixes/sufixes in order to identify the
different set of properties - like <code>jdbc.prop1=value</code>. After
some analysis it became clear my system required a more sophisticated
configuration mechanism than a collection of key/value pairs of strings.
It requires nested structures and better yet if it can have validation
of its configuration data. Natural conclusion: these requirements can be
easily achieved with an XML file. After deciding to use XML, I evaluated
some options, including different XML frameworks and also the usage of
XML with the Java API. I also checked the new features of JAXB 2.0, and
the fact it is already distributed with the JRE 1.6 convinced me that
JAXB is a first class configuration binder. The figure below summarizes
my observations about property files versus XML:</p>
<table width='100%' border='1'>
	<tr align='left'>
		<th>Option #1: several Properties</th>
		<th>Option #2: XML file converted in <em>Configuration
		Object</em> through JAXB</th>
	</tr>
	<tr align='center'>
		<td width='50%'><img alt="footprop.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/footprop.jpg" width="398" height="184" /></td>
		<td width='50%'><img alt="footjaxb.jpg" src="http://weblogs.java.net/blog/felipegaucho/archive/footjaxb.jpg" width="199" height="184" /></td>
	</tr>
	<tr valign='top'>
		<td>
		<ul>
			<li><strong><font color='green'>Good:</font></strong>
			<ol>
				<li>Plain text file</li>
				<li>Easy visualization of key/values pairs</li>
				<li>Simple code for reading the properties</li>
				<li>Default Java API - required classes are distributed as part
				of JRE (since 1.2)</li>
			</ol>
			</li>
		</ul>
		<ul>
			<li><strong><font color='red'>Bad:</font></strong>
			<ol>
				<li>Several files to manage</li>
				<li>Weak validation of files structure and contents</li>
				<li>Text editors or IDEs don't help to identify problems</li>
				<li>String + primitive types representation only</li>
				<li>Error prone - it is very hard to visualize missing data</li>
				<li>Custom binder - it requires a custom code to convert String
				values in Java Objects</li>
				<li>Inclusion of new key/pair on demand - hard to control the
				mess in big teams</li>
			</ol>
			</li>
		</ul>
		</td>
		<td>
		<ul>
			<li><strong><font color='green'>Good:</font></strong>
			<ol>
				<li>Plain text file</li>
				<li>Only 1 file to manage</li>
				<li>Configuration data defined in a model</li>
				<li>Validation support by default using the XML Schema</li>
				<li>Configuration versioning</li>
				<li>Data types and values range configurable in the model</li>
				<li>Any Java type supported</li>
				<li>Default Java API - required classes are distributed as part
				of JRE (since 1.6)</li>
				<li>Full support from IDEs in editing time (highlight,
				validation and auto-complete)</li>
				<li>Missing data never happens</li>
				<li>Automatic binding between the configuration values in Java
				Objects</li>
				<li>Inclusion of new properties depends on model changing -
				more easy to control the mess in big teams - just keep the model
				locked ;)</li>
			</ol>
			</li>
		</ul>
		<ul>
			<li><strong><font color='red'>Bad</font>:</strong>
			<ol>
				<li>Difficulty in visualizing the information</li>
				<li>Any new configuration value impacts in a model changing</li>
			</ol>
			</li>
		</ul>
		</td>
	</tr>
</table>

<h4>Implemented solution: binding XML properties to <em>Configuration
Object</em> through JAXB 2.0</h4>
<p>The full source code I used to implement my JAXB based properties
mechanism is available at the <a
	href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-core/src/net/java/dev/footprint/xml/'>Footprint
SVN repository</a> - including the <a
	href='https://footprint.dev.java.net/source/browse/*checkout*/footprint/tags/footprint-07.10.23/footprint-core/build.xml?rev=259'>ANT
task required to create the XML<->Object binder using XJC</a>. I strongly
recommend you to download the footprint source code and try it a bit
before checking my conclusions at the end of this blog. Inspecting the
code you will start seeing how clean is the application regarding to its
configuration properties. I don't have hard-coded String representing
the configuration acronyms, and I don't need to verify if the values in
the properties are consistent with the values required by the code, it
is implicit since we are calling the methods of the <em>Configuration
Object</em> that are homonymous to the properties names. Other comfortable
feature: if I modify the XML schema or try to change the code in a way
both sides become inconsistent, the IDE will notify the problem,
avoiding me to crash my own code - the code will not compile before the
classes and the properties model become consistent to each other, even
under that stressful deadline :)</p>
<p><strong>First step</strong>: you first need to create a <a
	href='https://footprint.dev.java.net/files/documents/7027/68644/footprint.xsd'>XML
Schema</a>, and then use an ANT task to generate the <em>XML&lt;-&gt;Object</em>
binder classes, like the one below:</p>
<p>
<pre>	&lt;taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"&gt;
		&lt;classpath refid="classpath.base" /&gt;
	&lt;/taskdef&gt;
	
	&lt;target name="compileschema"&gt;
		&lt;echo message="Compiling the Curriculum XML Schema..." /&gt;
		&lt;mkdir dir="${jaxb.classes.dir}" /&gt;
		&lt;xjc schema="${schema}" extension="true"
			classpath="${build.dir.classes}" target="${generated.dir}"
			package="${jaxb.bindingclasses.package}"&gt;
			&lt;produces dir="${jaxb.classes.dir}" includes="**/*.java" /&gt;
		&lt;/xjc&gt;
		&lt;javac srcdir="${generated.dir}" destdir="${generated.dir}"
			debug="off" source="1.5" /&gt;
		&lt;jar destfile="lib/footprint-config.jar" basedir="${generated.dir}"
			excludes="**/*.java" /&gt;
		&lt;delete dir="${generated.dir}" /&gt;
	&lt;/target&gt;
</pre>
</p>

<p>Before discussing the pros and cons of the JAXB adoption, let me
show some code fragments. What we need to do is to load and to use the
configuration properties, what is quite easy with the newest version of
JAXB. The validation of the XML against its schema is automatic, but I
can also implement a finer verification of the properties data using the
<em>Event Callbacks</em> mechanism provided by JAXB.</p>
<ol>
	<li>A code for reading the XML properties file: <pre><code>	@SuppressWarnings("unchecked")
	public JAXBElement<FootprintProperties> read(InputStreamReader inputStream)
			throws Exception {
		JAXBContext jc = JAXBContext.newInstance(
				AbstractJaxbFootprintStream.FOOTPRINT_CONTEXT, this.getClass()
						.getClassLoader());

		Unmarshaller unmarshaller = jc.createUnmarshaller();
		unmarshaller.setEventHandler(new FootprintConfigValidationHandler());
		unmarshaller.setListener(listener);
		SchemaFactory sf = SchemaFactory
				.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
		Schema schema = sf.newSchema(getClass().getClassLoader().getResource(
				AbstractJaxbFootprintStream.SCHEMA_FILE));
		unmarshaller.setSchema(schema);

		JAXBElement<FootprintProperties> footprintProperties = (JAXBElement<FootprintProperties>) unmarshaller
				.unmarshal(inputStream);
		return footprintProperties;
		<font color='green'><em>// That's it! From this point I have a Java Object I use to retrieve the configuration values</em></font>
	}
	</code></pre></li>
	<li>After binding the properties to Java Object, I can manipulate
	its attributes as any other class: <pre><code>	private void DemoMethod(FootprintProperties properties) {
		ConfigEmail email = config.getEmail();
		setMsgFrom(email.getMsgFrom()); <font color='green'><em>// GOODBYE hard-coded strings like prop.get("</em></font><font
		color='red'>msg.from</font><font color='green'><em>");</em></font>
	}
</code></pre></li>
	<li>An <strong>optional</strong> <a
		href='http://java.sun.com/webservices/docs/2.0/api/javax/xml/bind/Unmarshaller.html#unmarshalEventCallback'>Unmarshal
	Event Callbacks</a>, to check what is being read. Observe in the code below
	that I can inspect every element of my configuration, which means I can
	stop the application loading if I detect something inconsistent. I am
	using this listener also to log what is being loaded. And since I have
	a model, I <em>know</em> what any fragment of my configuration file is
	about and I can do extra verification on the config values. Eventually
	I can also modify the created Object based on custom requirements. <pre><code>	@Override
	public void afterUnmarshal(Object target, Object parent) {
		if (target instanceof ConfigEmail) {
			validateEmailData((ConfigEmail) target);
		}
		...
	}
		
	<font color='green'><em>// Observe I don't need to check if the </em><code>msgTo</code><em> attribute is present or not
	// in my property file, the model guarantee that.</em></font>
	private void validateEmailData(ConfigEmail email) {
		String msgFrom = email.getMsgFrom();
		Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
		Matcher m = p.matcher(msgFrom);
		boolean matchFound = m.matches();
		if (!matchFound) {
			severe(FootprintConfigUnmarshallerListener.I18N_KEY_EMAIL_MALLFORMED,
				new String[] { msgFrom });
		}
	}</code></pre></li>
</ol>
<h4>Conclusions</h4>
<p>The implemented code works fine, and despite I didn't stressed
too much the tests, I have some observations:</p>
<ol>
	<li>The loading performance is good, since a regular configuration
	file is never more than hundreds of values.</li>
	<li>Memory impact: large sets of configuration can cause an
	explosion of Objects in the memory, and that is a good thing to keep in
	mind: each element of the XML will instantiate a different Object.</li>
	<li>The complexity of the reading/writing algorithm is similar do
	the one required by the <code>java.util.Properties</code>, and after
	creating it once you can reuse it later.</li>
	<li>The validation and verification of the configuration data are
	sound and robust processes - much more elegant and safe than using
	properties files.</li>
	<li>Open the configuration example XML in your preferred IDE, and
	you will notice the helpful support available there, including
	highlight and auto-complete features.</li>
	<li>Think about the natural match between the XML structure and
	the beans editors code out there. It is quite easy to create a GUI that
	presents to the user a tree with all configuration elements and its
	respective editors. I started a <a
		href='https://footprint.dev.java.net/source/browse/footprint/trunk/footprint-demo/'>Swing
	prototype here</a>, but it is still a pending task. Eventually I will use
	the NetBeans platform, that gives me a wonderful beans editor support,
	or even try JavaFX to produce the configuration editor GUI.</li>
</ol>
<p>A polemic topic is about the large amount of Objects loaded in
memory, what is controversial if you consider what happens when you load
values using <code>java.util.Properties</code>. The properties are
loaded as Strings, what in the worst case means one String object to
each value. Even considering Strings are lightweight objects compared to
complex types, all Strings will be used to instantiate an Object at some
part of your code. One can suggest JAXB is much heavier since it loads
all objects at once, while properties being used by demand will rarely
cause all objects being loaded together. I agree in terms, but I think
JAXB provides a better productivity - reducing the chances of mistakes
and facilitating the verification of the configuration and the code.
Imagine a developer using auto-complete for loading the properties,
instead of checking constants somewhere or including weird hard-coded
String all over the code. It is up to you to think about that.</p>
<p>My overall feeling about using JAXB instead of Properties is very
good, I am feeling much more confident to code based on Objects than
based on collection of Strings. At the end, both approaches are quite
similar in terms of logic, but since I am an Object Oriented developer,
I prefer to manipulate objects than lists of values - the old fashion
procedural approach.</p>
</body>
</html>]]>

</content>
</entry>
<entry>
<title>Footprint: stable release is out (codename: FOR)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/felipegaucho/archive/2007/10/footprint_stabl.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-10-23T15:45:33Z</issued>
<id>tag:weblogs.java.net,2007:/blog/felipegaucho/287.8475</id>
<created>2007-10-23T15:45:33Z</created>
<summary type="text/plain">After few months of experiences and reviews, the first stable release of Footprint project is out,
with codename FOR - acronym of the Fortaleza airport. It includes a demo that shows how
to use the project library to easily send signed PDF files through email.
</summary>
<author>
<name>felipegaucho</name>

<email>felipegaucho@dev.java.net</email>
</author>
<dc:subject>Community: Java User Groups</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/felipegaucho/">
<![CDATA[<table><tr><td><p>After a long vacation, I finally had time to release the first stable release of Footprint :).  The project is new and should evolve to something more sophisticated in the next few months. For now, we are proud to provide the community a simple tool to enhance the quality of JUG events or perhaps bigger or more commercial events. I hope you follow our Footprint.</p><p>* <i>The project's license is LGPL and the full source code is available at the <a href='https://footprint.dev.java.net/source/browse/footprint/'>SVN repository</a></i>.
</p></td><td><img src="https://footprint.dev.java.net/files/documents/7027/59103/footlogo.jpg" alt="Our new project logo" title="Footprint Logo" border="0" height="99" width="99"></td>
</tr></table>
<h4>The Footprint project</h4>
<p>As explained in <a href='http://weblogs.java.net/blog/felipegaucho/archive/2007/06/introducing_the.html'>
my last blog about the Footprint</a>, the aim of the project is to provide an easy way
of delivering certificates to JUG meetings attendants. The basic user story is the following:
<ol>
<li>The JUG promotes an event.</li>
<li>During the event, a JUG representative collects the name and email of the participants.</li>
<li>After the event, all participants receive a certificate of presence - signed PDF file - through email.</li>
<li>The generated certificates can be validated through the public key of the JUG, published in the JUG web site.</li>
</ol>
</p>
<h4>How it works?</h4>
<p>
The algorithm of footprint:
<ol>
<li>Reads an XML config file, and uses JAXB to construct an Object representation of the configuration. The
configuration file contains several definitions, such as JDBC connection, PDF template and keystore details.</li>
<li>Reads the PDF template, previously created with OpenOffice or other PDF generator tool.</li>
<li>Access the JDBC connection to read the JUG members data. For each addressee:
<ol><li>Fill the PDF template with the member data (name, address, etc.)</li>
<li>Generate a new PDF file with the member information.</li>
<li>Sign the new PDF</li>
<li>Send the new file by email to the addressee</li></ol>
</li>
</ol>
</p><p>The security part of the project is based on the <a href='http://www.bouncycastle.org/'>Bouncy Castle's library</a>, and all PDF manipulation is done with the fantastic <a href='http://www.lowagie.com/iText/'>iText</a> library. Other basic features are the logging over all operations and the internationalization of all classes.
</p>
<h4>How to run the example?</h4>
<p>The release contains a README.txt file with brief instruction on how to start using Footprint, but in short you must:
<ol>
<li><a href='https://footprint.dev.java.net/'>download</a> the release and extract it in your computer.</li>
<li>Edit the file <code>resources/configExample.xml</code> and change the user and password of the SMTP server:
<pre>
&lt;email smtp.user="<font color='red'>EMAIL_ACCOUNT_LOGIN</font>" smtp.password="<font color='red'>EMAIL_ACCOUNT_PASSWORD</font>" msg.from="<font color='red'>EMAIL_ACCOUNT_LOGIN</font>" smtp.transfer.protocol="smtp"
	smtp.star.ttls.enable="true" smtp.host="<font color='red'>SMTP_HOST</font>" smtp.content.type="text/plain"
	smtp.auth="true" socks.proxy.port="" socks.proxy.host=""
	msg.subject="Footprint Certificate - DEMO"
	msg.body="You can write a message body here.. or customize it through the code, check the demo file..." /&gt;
 /&gt;
</pre>The example comes pre-configured to access the gmail server, but you can change it to any SMTP server. You can also configure the proxy information in case you are behind a firewall. You can also try a first time without configuring the SMTP settings, it will generate the signed PDF without sending it through email.</li>
<li>Edit the file <code>demo.csv</code> in order to include an email address you can verify later :). You can include several new lines in this file in order to observe the system generating multiple PDFs. 
<li>Open a console and run the following command:<pre>java -cp .;lib\bcprov-jdk16-136.jar;lib\csvjdbc.jar;lib\footprint-config.jar;lib\footprint-core.jar;lib\itext-2.0.2.jar;lib\mail.jar FootprintDemo</pre></li>
</ol>
</p>
<p>That's it - if it fails for any reason, please don't hesitate  to send me an email with the failure description.</p>
<h4>How to change the configuration file?</h4>
<p>Documentation is an issue by design of our project. Since we don't have many collaborators, we always prioritize the implementation (code first). But you can check the <a href='https://footprint.dev.java.net/files/documents/7027/68644/footprint.xsd'>configuration schema</a>, and if you have doubts about its structure, please leave a comment below this page.</p>
]]>

</content>
</entry>

</feed>