<?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>breddy.net &#187; Professional</title>
	<atom:link href="http://www.breddy.net/category/professional/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.breddy.net</link>
	<description>Personal and professional weblog of Chris Bredesen</description>
	<lastBuildDate>Tue, 21 Jun 2011 20:31:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Presentation Notes: TriJUG April 18, 2011</title>
		<link>http://www.breddy.net/2011/04/19/trijug-april-cdi/</link>
		<comments>http://www.breddy.net/2011/04/19/trijug-april-cdi/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 12:54:59 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jug]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://www.breddy.net/?p=173</guid>
		<description><![CDATA[Presentation outline and notes/references for my  Traiangle Java User&#8217;s Group presentation given on April 18, 2011.  The slides used during the presentation are merely an instrument for me as the presenter; they aren&#8217;t available for download.  Below is the rough &#8230; <a href="http://www.breddy.net/2011/04/19/trijug-april-cdi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Presentation outline and notes/references for my  <a href="http://trijug.org">Traiangle Java User&#8217;s Group</a> presentation given on April 18, 2011.  The slides used during the presentation are merely an instrument for me as the presenter; they aren&#8217;t available for download.  Below is the rough outline I (kinda) followed and at the bottom are references and helpful links.  Feel free to leave any and all candid feedback in the comments.  Thanks for attending!<span id="more-173"></span></p>
<h3>Modern Web Component Development with Java EE6 and Arquillian</h3>
<h3>Outline</h3>
<ul>
<li>About Me
<ul>
<li>Chris Bredesen  &#8211; Product Manager, Red Hat Customer Portal</li>
</ul>
</li>
<li>Agenda
<ul>
<li>Brief History</li>
<li>CDI</li>
<li>Arquillian</li>
<li>Anatomy of an EE6 application</li>
<li>Informal audience survey &#8211; Spring / Seam / EE 5/6 usage?</li>
</ul>
</li>
<li>J2EE 1.4
<ul>
<li>InitialContext ctx = &#8230;..</li>
<li>No DI; JNDI gave us a registry</li>
<li>Clients look up what&#8217;s needed (&#8220;traditional&#8221; control structure)</li>
</ul>
</li>
<li>Java EE 5
<ul>
<li>Limited (but well-defined!) component types&#8230;</li>
<li>@Stateless / Stateful</li>
<li>&#8230;that can be injected into other EE 5 components</li>
<li>@EJB</li>
<li>@Resource</li>
<li>@PersistenceContext</li>
</ul>
</li>
<li>Seam 1.x &amp; 2.x
<ul>
<li>Leverages EE rather than sidestepping it
<ul>
<li>Introduced what was to become the CDI &#8220;programming model&#8221;</li>
<li>Somewhat tightly coupled with JSF 1 &amp; a web container</li>
<li>Annotation-based component declaration</li>
<li>Events</li>
<li>Stateful/Conversational model that optionally uses EJB3</li>
</ul>
</li>
<li>Rich web framework
<ul>
<li>MVC (both pull- and push-style)</li>
<li>Security</li>
<li>Persistence</li>
<li>Localization</li>
<li>Greatly improves JSF&#8217;s navigation rules (far less verbose and limited)</li>
<li>Bookmarkable URL&#8217;s / GET support</li>
</ul>
</li>
<li>Built-in integration with Drools, RESTEasy, etc</li>
</ul>
</li>
<li>Java EE6
<ul>
<li>Robust, flexible DI via CDI</li>
<li>EJB 3.1 (no-interface views, finally!)</li>
<li>JAX-RS  &#8211; Profiles (web, EE)</li>
</ul>
</li>
<li>CDI Overview
<ul>
<li>Standarization and improvement of the Seam component model + Guice)</li>
<li>@Inject (aligned with JSR-330)</li>
<li>@Named</li>
<li>@Produces</li>
<li>@RequestScoped</li>
</ul>
</li>
<li>CDI Overview (cont&#8217;d)
<ul>
<li>Contexts
<ul>
<li>@ApplicationScoped</li>
<li>@SessionScoped</li>
<li>@ConversationScoped</li>
<li>@RequestScoped</li>
<li>@[Anything]Scoped &#8211; pluggable contexts!
<ul>
<li>@ThreadScoped &#8211; via ThreadLocal</li>
<li>@CacheScoped &#8211; via Cache impl</li>
</ul>
</li>
</ul>
</li>
<li>Lifecycle
<ul>
<li>Robust scoping requires robust lifecycle management</li>
<li>Callbacks</li>
<li>Managed instances that end when the scope does</li>
</ul>
</li>
<li>Events
<ul>
<li>Bridgeable to JMS</li>
</ul>
</li>
<li>Well-defined SPI for creating portable extensions</li>
</ul>
</li>
<li>CDI Overview (cont&#8217;d)
<ul>
<li>Seam was too many things</li>
<li>CDI is a core framework &amp; programming model</li>
<li>Web toolkits can be built on top of CDI via portable extensions</li>
</ul>
</li>
<li>CDI Overview (cont&#8217;d)
<ul>
<li>Stereotypes help group common sets of annotations</li>
</ul>
</li>
<li>JSF2 adds many features that Seam had
<ul>
<li>Page level metadata/navigation &lt;f:metadata&gt;</li>
<li>EL integration with CDI</li>
<li>Better GET support</li>
</ul>
</li>
<li>Cross-container testing  &#8211; Arquillian  &#8211; ShrinkWrap</li>
<li>Anatomy of an EE 6 Application</li>
</ul>
<h3>Tools Used</h3>
<ul>
<li>JBoss AS 6.0 Final</li>
<li>Eclipse for Java EE developers 3.6 SR2</li>
<li>JBoss Tools 3.2</li>
<li>m2eclipse 0.12 (make sure to install WTP support!)</li>
<li>Maven 3.0.3</li>
</ul>
<h3>References &amp; Other Reading Material</h3>
<ul>
<li>CDI Quickstart for Maven <a href="http://seamframework.org/Documentation/CDIQuickstartForMavenUsers">http://seamframework.org/Documentation/CDIQuickstartForMavenUsers</a></li>
<li>Weld reference <a href="http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html/">http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html/</a></li>
<li>JSR-299 <a href="http://www.jcp.org/en/jsr/detail?id=299">http://www.jcp.org/en/jsr/detail?id=299</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2011/04/19/trijug-april-cdi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile Software Development with Rally</title>
		<link>http://www.breddy.net/2010/12/17/agile-software-development-with-rally/</link>
		<comments>http://www.breddy.net/2010/12/17/agile-software-development-with-rally/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 23:52:09 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[dev]]></category>

		<guid isPermaLink="false">http://www.breddy.net/?p=148</guid>
		<description><![CDATA[Some time back, I whined about not having a good agile project tool.  Times have changed:  four years and two jobs later I&#8217;m happily doing Scrum development using Rally. It didn&#8217;t happen overnight.  Red Hat is a big consumer of &#8230; <a href="http://www.breddy.net/2010/12/17/agile-software-development-with-rally/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some time back, I <span style="color: #000000;"><a href="http://www.breddy.net/2006/05/23/agile-projectissue-management/">whined</a></span> about not having a good agile project tool.  Times have changed:  four years and two jobs later I&#8217;m happily doing <a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a> development using <a href="http://www.rallydev.com/agile_products/editions/enterprise/">Rally</a>.</p>
<p><span id="more-148"></span>It didn&#8217;t happen overnight.  Red Hat is a big consumer of <a href="http://www.bugzilla.org/">Bugzilla</a> and in the beginning of our project, we agreed that rather than adopt the existing tool-du-jour (XPlanner) in addition to Bugzilla, we&#8217;d stick with what we knew well and build a process around that.</p>
<p>It worked, sorta, but we quickly became hindered by Bugzilla&#8217;s lack of anything resembling a workflow. We&#8217;d file user stories as bugs but since the tool is so cumbersome to use, we&#8217;d rarely task them out properly.  Some things would slip and other things would take scrum team members by surprise.  I&#8217;m no fan of Bugzilla, but in Mozilla&#8217;s defense, they aren&#8217;t really trying to do agile.</p>
<p>We decided as a team to adopt Rally since we already had some seats set aside for it.  I&#8217;m happy to report that thus far (half a sprint in), we&#8217;re pretty pleased.  It steps up in all the places Bugzilla falls over:</p>
<ul>
<li>Dead simple creation of tasks per story</li>
<li>Resource management</li>
<li>Implicit grouping of tasks under a story such that hours/progress are aggregated meaningfully</li>
<li>Quick in-place editing (BZ languishes in web 1.0)</li>
<li>Built-in workflow &amp; reporting designed for agile development</li>
<li>Useful dashboard that displays rich information about the current sprint (tasks, defects, blockers, burndown)</li>
</ul>
<p>We&#8217;re still deciding what to do with our large Bugzilla backlog, but it turns out there may be a <a href="https://wiki.rallydev.com/display/rlyintgrs/Bugzilla">plugin</a> we can use.  If we go that route, I hope to have time to blog about it in a future posting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2010/12/17/agile-software-development-with-rally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Environmental Config Files</title>
		<link>http://www.breddy.net/2007/02/03/environmental-config-files/</link>
		<comments>http://www.breddy.net/2007/02/03/environmental-config-files/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 18:33:41 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2007/02/03/environmental-config-files/</guid>
		<description><![CDATA[I came across something disturbing recently and I want to get my two cents on the table because this isn&#8217;t the first time it&#8217;s come up. Several components in the project I&#8217;m assigned to store various configuration attributes in text &#8230; <a href="http://www.breddy.net/2007/02/03/environmental-config-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I came across something disturbing recently and I want to get my two cents on the table because this isn&#8217;t the first time it&#8217;s come up.  Several components in the project I&#8217;m assigned to store various configuration attributes in text files.  Whether they&#8217;re name-value (properties) files or XML data, this is a good choice because it allows the customization of application behavior without code changes or redeployment &#8230; if you do it properly.<br />
<span id="more-60"></span><br />
What I encountered in several places is a conf directory which contained subdirectories which resemble the following:  /local, /dev, /test, /stg, /prod.</p>
<p>At first glance, this looks completely reasonable especially if you consider that each corresponding environment declares a container-level variable whose value is one of the directory names (Development/Integration=dev, UAT/Test=test, etc.).  Developers get to configure each environment and at deployment time  the server simply knows how to behave based on the preset environment variable.  Sounds OK, right?</p>
<p>NO!  It isn&#8217;t OK.  It is horrible and you should never do it.  Packaging configuration in with code leaves the <em>System Administrator</em> powerless to <em>administer</em> the <em>system</em>.  See the problem?  No?  Here are more reasons:</p>
<ul>
<li>Configuration changes require a redeployment of the application (possibly even repackaging)</li>
<li>Developers may not (indeed, <em>should</em> not) be privy to certain config information (passwords, let&#8217;s say) for production environments</li>
<li>Test environments of the same &#8220;level&#8221; can&#8217;t have differing configuration unless you jump through hoops like branching source code</li>
<li>Turning a dev/test/stage box into a production one (or vice versa) with one small change is just scary</li>
<li>A developer can change production and nobody will notice until the code gets to production!</li>
<li><strong>A developer can change production and nobody will notice until the code gets to production!</strong></li>
<li><strong>A DEVELOPER CAN CHANGE PRODUCTION AND NOBODY WILL NOTICE UNTIL THE CODE GETS TO PRODUCTION!</strong></li>
</ul>
<p>Get it?</p>
<p>The way to manage configuration is to provide a nicely-commented <em>prototype</em> config file (that can&#8217;t/won&#8217;t be read) with your application and leave the runtime configuration in a file outside the deployed application path.  There are many ways to make such files available to your program regardless of whether you&#8217;re using a container or not.  You can:</p>
<ul>
<li>Add a <tt>conf</tt> directory to the runtime classpath</li>
<li>Put the config files in a known directory such as <tt>common/classes</tt> on Tomcat</li>
<li>Jar them up and name them according to environment, if you just absolutely must not let the admins touch them.</li>
</ul>
<p>Any of these tactics work.  As long as you aren&#8217;t marrying code and configuration, you can&#8217;t miss.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2007/02/03/environmental-config-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu</title>
		<link>http://www.breddy.net/2007/01/08/ubuntu/</link>
		<comments>http://www.breddy.net/2007/01/08/ubuntu/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 02:34:21 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2007/01/08/ubuntu/</guid>
		<description><![CDATA[I&#8217;m typing this post from the Gnome blog post client installed on my laptop which is now running Ubuntu Linux. I took the plunge a few days ago after getting the itch to try an alternative OS. I knew that &#8230; <a href="http://www.breddy.net/2007/01/08/ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m typing this post from the Gnome blog post client installed on my laptop which is now running Ubuntu Linux.  I took the plunge a few days ago after getting the itch to try an alternative OS.  I knew that if I did a dual-boot, I&#8217;d bail out and revert to Windows in a few days.  So, I blew away the entire disk and let Ubuntu 6.10 have its way.</p>
<p>So far I&#8217;m pretty pleased.  The out-of-the box suite of applications is more than adequite for the average user, and it&#8217;s Linux, so the power user will never be left wanting.  The only stumbling I&#8217;ve done is on multimedia codecs.  So far I have yet to get anything resembling Internet-type audio/video to play, but I&#8217;m not sure I&#8217;ve done everything right.  Flash 9 beta is installed so all my favorite rich-clienty sites work well (Google Finance, YouTube, etc).  No MP3 or AVI joy yet though.</p>
<p>I&#8217;ll wrap this up and hope it posts, with the thought that I&#8217;ll do a more in-depth review soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2007/01/08/ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IETab Firefox Plugin</title>
		<link>http://www.breddy.net/2006/08/29/ietab-firefox-plugin/</link>
		<comments>http://www.breddy.net/2006/08/29/ietab-firefox-plugin/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 23:28:26 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/08/29/ietab-firefox-plugin/</guid>
		<description><![CDATA[Not much else to say about this sweet plugin.Â  It lets you view any webpage using IE without leaving Firefox.Â  Kickass.]]></description>
			<content:encoded><![CDATA[<p>Not much else to say about this sweet <a title="IETab at MozDev" href="http://ietab.mozdev.org/">plugin</a>.Â  It lets you view any webpage using IE without leaving Firefox.Â  Kickass.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/08/29/ietab-firefox-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Too Many Choices?</title>
		<link>http://www.breddy.net/2006/08/08/too-many-choices/</link>
		<comments>http://www.breddy.net/2006/08/08/too-many-choices/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 00:58:06 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/08/08/too-many-choices/</guid>
		<description><![CDATA[Thinking about beginning a new JEE project is as unsettling as it is exciting. On the one hand, you&#8217;re going to get your hands dirty with some new and challenging business problem to solve, you can use the latest and &#8230; <a href="http://www.breddy.net/2006/08/08/too-many-choices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Thinking about beginning a new JEE project is as unsettling as it is exciting.  On the one hand, you&#8217;re going to get your hands dirty with some new and challenging business problem to solve, you can use the latest and greatest JVM and of course let&#8217;s not forget the <strong>choice</strong> of many excellent application/persistence/web frameworks.  On the other hand, you have &#8230; the choice of <strong>many</strong> excellent application/persistence/web frameworks!</p>
<p>I think we can all agree that choice is good, but is the sheer number of non-trivial frameworks really unifying the java community, or are we breeding segments of the population who know only a subset of what&#8217;s out there?</p>
<p>When you&#8217;re an ASP guy, you pretty much have you work cut out for you.  Same goes for the new kid on the block Ruby [on Rails].  But Java, in its maturity, has brought so many innovations to market that one could make an entire project out of evaluating frameworks for use in any given project!</p>
<p>The days of Struts &#038; JDBC are pretty much over, kids.  Do you use Spring at the web tier?  How &#8217;bout JSF or Tapestry or WebWork?  Do you decorate with SiteMesh, or assemble with Tiles?  Maybe you are into JSP includes or writing a lot of custom tags.  Do you manage your middle tier with Spring, or opt for the latest appserver&#8217;s EJB3 implementation?  It might seem like everyone is using Hibernate for persistence, but it aint the only kid on the block.  TopLink Essentials is bundled with GlassFish and other EE5 offerings will be supporting JPA as well.  This is just the tip of the iceberg.</p>
<p>How do you decide?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/08/08/too-many-choices/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Should Salaries be Secret?</title>
		<link>http://www.breddy.net/2006/08/08/should-salaries-be-secret/</link>
		<comments>http://www.breddy.net/2006/08/08/should-salaries-be-secret/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 13:55:27 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/08/08/should-salaries-be-secret/</guid>
		<description><![CDATA[This interesting post raises this very question and even makes the case that no, they should not be. Keeping salaries under wraps is the default protocol here in the U.S. of A., and I now wonder if it does more &#8230; <a href="http://www.breddy.net/2006/08/08/should-salaries-be-secret/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Why secret salaries are a baaaad idea [positivesharing.com]" href="http://positivesharing.com/2006/08/why-secret-salaries-are-a-baaaaaad-idea">This interesting post</a> raises this very question and even makes the case that no, they should not be.  Keeping salaries under wraps is the default protocol here in the U.S. of A., and I now wonder if it does more harm than good.  Here&#8217;s one of the key points that made me think:</p>
<blockquote><p>And here&#8217;s the problem: If Johnson&#8217;s salary is (unfairly) higher than mine, and secret, I can&#8217;t complain to my manager about it because I can&#8217;t admit that I know about it. When a company sets up a situation where people can see the unfairness but can&#8217;t address it directly, or even discuss it openly, they&#8217;re rigging the system for maximum frustration.</p></blockquote>
<p>The author cites another potential problem, one I have experienced first hand:</p>
<blockquote><p>I have worked at two different companies where salaries were secret and guess what: They weren&#8217;t. Most people knew what most others were getting. In one company I consulted for, the IT department had even found the Excel spreadsheets HR kept the salaries in. They knew what everyone was getting.</p></blockquote>
<p>This blurb speaks to the larger issue of <a title="Information asymmetry at Wikipedia" href="http://en.wikipedia.org/wiki/Information_asymmetry">information asymmetry</a>, the term given to a situation in which those who possess information can choose to use it against those who do not.  Leaked information becomes contraband and fosters even more frustration.  And as Young MC says, &#8220;From frustration first inclination / Is to become a monk and leave the situation&#8221;.  But every dark tunnel has a lighter hope, so maybe transparency is the way forward.</p>
<p>What do you think?  Would you prefer working in an open environment like this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/08/08/should-salaries-be-secret/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Layout Gala</title>
		<link>http://www.breddy.net/2006/07/10/css-layout-gala/</link>
		<comments>http://www.breddy.net/2006/07/10/css-layout-gala/#comments</comments>
		<pubDate>Tue, 11 Jul 2006 00:33:26 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/07/10/css-layout-gala/</guid>
		<description><![CDATA[This is just too freakin sweet not to pass along. I&#8217;m not a regular del.icio.us user, but I happend to stop by today only to be greeted with this gem: Layout Gala I had to give this treasure its own &#8230; <a href="http://www.breddy.net/2006/07/10/css-layout-gala/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is just too freakin sweet not to pass along.  I&#8217;m not a regular <a title="del.icio.us" href="http://del.icio.us">del.icio.us</a> user, but I happend to stop by today only to be greeted with this gem:</p>
<p><a title="Layout Gala" href="http://blog.html.it/layoutgala/">Layout Gala</a></p>
<p>I had to give this treasure its own line because it embodies everything that is good and right in the field of web design.  Pure, compatible, solid layouts that don&#8217;t rely on hacks.  They&#8217;re all there, kids.  Two-column, three-column, liquid, static &#8212; many even support <a title="Any Order Columns" href="http://www.positioniseverything.net/articles/onetruelayout/anyorder">any-order columns</a>.  Squirt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/07/10/css-layout-gala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing a JBoss EJB3 Session Bean With Spring</title>
		<link>http://www.breddy.net/2006/07/06/accessing-a-jboss-ejb3-session-bean-with-spring/</link>
		<comments>http://www.breddy.net/2006/07/06/accessing-a-jboss-ejb3-session-bean-with-spring/#comments</comments>
		<pubDate>Thu, 06 Jul 2006 17:34:09 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/07/06/accessing-a-jboss-ejb3-session-bean-with-spring/</guid>
		<description><![CDATA[Spring and Hibernate have long been my choice of frameworks with which to construct maintainable, scalable middle-tier software. Spring promotes good OO design using loose coupling and provides excellent declarative transaction support. Hibernate is the persistence tool of choice for &#8230; <a href="http://www.breddy.net/2006/07/06/accessing-a-jboss-ejb3-session-bean-with-spring/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Spring and Hibernate have long been my choice of frameworks with which to construct maintainable, scalable middle-tier software.  Spring promotes good OO design using loose coupling and provides excellent declarative transaction support.  Hibernate is the persistence tool of choice for the open source community.  Any sane person who programs this way will have given up on EJB long ago.  Coarse-grained entities, tightly coupled service objects and XML deployment descripters a-plenty are enough to bring a guy to his knees.</p>
<p>But no more.  The EJB expert group, now composed of some of the very creators of modern persistence framework, has bequeathed upon us something wonderful.  The lightweight POJO programming model we have come to love is apparent everywhere in the EJB 3.0 specifiction (<a title="JSR-220" href="http://www.jcp.org/en/jsr/detail?id=220" target="_blank">JSR-220</a>), which was <a title="JSR-220 voting results" href="http://www.jcp.org/en/jsr/results?id=3768" target="_blank">unanimously accepted</a> by the <a title="Java Community Process" href="http://www.jcp.org" target="_blank">JCP</a> earlier this year.  EJB 3.0 is just one goodie in the larger <a title="Java EE 5 What's New" href="http://java.sun.com/javaee/overview/whatsnew.jsp" target="_blank">Java EE 5</a> (<a title="JSR-244" href="http://www.jcp.org/en/jsr/detail?id=244" target="_blank">JSR-244</a>) bag &#8211; but this post is going to be long enough as it is.<span id="more-40"></span></p>
<p>When I returned from Las Vegas with my newfound interest in EJB, my first task at hand was to create a little test application that demonstrated the scenario that is most applicable to my work:  EJB3 services remoted over RMI consumed with POJO web applications that already use Spring.  This use case stems from the need that we have realized the need to segment a growing middle-tier application from the monolithic beast it is destined to become into smaller, more manageable services.  The client programs (mostly web applications) already access the business interfaces using Spring.</p>
<p>I&#8217;m going to skip the gory details of setting up the server, creating a project and all the like.  There are plenty of explanations of this elsewhere.  Besides, this post is going to be long enough as it is.</p>
<p>First we need a business interface.  How about something really complex:</p>
<p>[java]<br />
public interface SimpleService {<br />
int stringLength(String string);<br />
}<br />
[/java]</p>
<p>Nothing fancy there.  Now let&#8217;s implement it with some logic:</p>
<p>[java]<br />
public class SimpleServiceBean implements SimpleService {<br />
public int stringLength(String string) {<br />
return string == null ? 0 : string.length();<br />
}<br />
}<br />
[/java]</p>
<p>Still totally straightforward.  Now let&#8217;s turn our bean into an EJB.  This is the <em>really</em> complicated part.  Watch for the annotations:</p>
<p>[java]<br />
@Stateless<br />
@Remote(SimpleService.class)<br />
public class SimpleServiceBean implements SimpleService {<br />
public int stringLength(String string) {<br />
return string == null ? 0 : string.length();<br />
}<br />
}<br />
[/java]</p>
<p>Did you get all that?  The <tt>@Stateless</tt> annotation tells us that this is a Stateless Session bean, and the <tt>@Remote</tt> annotation specifies the remote interface.  <em>Everything else is handled by the container.</em> Although the footwork is managed by the container in a somewhat vendor-specific way, the annotations are standard Java EE, and so you&#8217;re not tied to an implementation. When you catch your breath, let&#8217;s move on.</p>
<p>Since Java EE 5 has embraced configuration by exception, we don&#8217;t even need any depoyment descriptors.  These two files can be compiled, JAR&#8217;d up and deployed to a server of your choosing &#8212; I used JBoss 4.0.4.</p>
<p>In order to have a client, we need to provide, at a minimum, the remote interfaces and any other classes or exceptions it references.  For testing, I just tossed the same JAR on the classpath since I know it contains everything I need.  Additionally, we need the Spring JARs (this test used 2.0RC1) and the JBoss client JAR&#8217;s.</p>
<p>The only real programming we have to do here is to create a Spring container that wires up to the server&#8217;s JNDI directory.  To do this, we&#8217;ll use Spring&#8217;s <tt>JndiObjectFactoryBean</tt>.  This part actually confused me because try as I did, I could never accomplish this feat using the more aptly-named <tt>SimpleRemoteStatelessSessionProxyFactoryBean</tt>.  The difference, apparently, is that since EJB3 places no specific requirements on the business, home or remote interfaces, there is less to do, and thus the client simply grabs the object and narrows it down as prescribed.  Here is my Spring configuration (minus the XML header and DTD info):</p>
<p>[xml]</p>
<p>org.jnp.interfaces.NamingContextFactory org.jboss.naming:org.jnp.interfaces jnp://localhost:1099<br />
[/xml]</p>
<p>The JNDI properties provided are JBoss specific, as is the provider URL.  These are included with the JBoss client JAR in the form of a jndi.properties file.  They are exactly the same as what would be used to construct a traditional <tt>InitialContext</tt> if this were a non-spring J2SE client.</p>
<p>JBoss mounts Remote interfaces (by default) using /remote, and Local interfaces using /local.  As you can see here, we&#8217;ve chosen the remote.  One could just as easily expose <tt>SimpleServiceBean</tt> as a Local EJB by using the <tt>@Local</tt> annotation and providing the same business interface as an arguement.  The Spring container changes only in URL and jndiName values.</p>
<p>Once the bean factory is configured, you can load it and request the remote <tt>SimpleServiceBean</tt> proxy by name (simpleService), casting it to <tt>SimpleService</tt> as you would normally do with a Spring-managed object.  It works flawlessly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/07/06/accessing-a-jboss-ejb3-session-bean-with-spring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seam, EJB3 and Gavin</title>
		<link>http://www.breddy.net/2006/06/13/seam-ejb3-and-gavin/</link>
		<comments>http://www.breddy.net/2006/06/13/seam-ejb3-and-gavin/#comments</comments>
		<pubDate>Wed, 14 Jun 2006 02:05:36 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.breddy.net/2006/06/13/seam-ejb3-and-gavin/</guid>
		<description><![CDATA[This afternoon&#8217;s festivities were highlited by a characteristically colorful presentation by Gavin King. For those who don&#8217;t know, Gavin is the creator of the Hibernate persistence framework which was aquired eventually by JBoss. Gavin &#38; crew demonstrated quickly but effectively &#8230; <a href="http://www.breddy.net/2006/06/13/seam-ejb3-and-gavin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This afternoon&#8217;s festivities were highlited by a characteristically colorful presentation by Gavin King.  For those who don&#8217;t know, Gavin is the creator of the <a title="Hibernate.org" href="http://www.hibernate.org/" target="_blank">Hibernate</a> persistence framework which was aquired eventually by JBoss.</p>
<p>Gavin &amp; crew demonstrated quickly but effectively the lovely synergy that has been brought to EJB3 and JSF by their newest creation, <a title="Seam homepage" href="http://labs.jboss.com/portal/jbossseam" target="_blank">Seam</a>.  Seam can hardly be called a web framework &#8212; you wouldn&#8217;t recognize it as such what with its lack of, well, just about everything that you&#8217;ve come to expect from a web framework.</p>
<p>Seam throws away boilerplate code a-la Rails, but does so in a way that leverages a lot of the untapped power of EJB3 and JSF. Seam is all about Don&#8217;t Repeat Yourself (DRY).  As such, we throw away form beans (a-la Spring MVC) and a whole lot of XML (in favor of annotations).</p>
<p>The most surprising theme that emerges from all of this is the rampant use of Stateful Session beans.  You read that right &#8211; I said Stateful.  Seam begs the question, &#8220;why on earth would I represent state in a database (slow is an understatement) or in HTTPSession (with no dirty checking) when I can use this lovely gift called Stateful beans?&#8221;  He makes a damn good point.  By representing web conversations as SFSB&#8217;s (which are POJO&#8217;s in EJB3, in case you&#8217;re wondering) you eliminate many of the headaches associated with web apps.  Multiple tabs open in your browser?  Piece of cake &#8211; each browser tab/session/window has a unique conversation (they&#8217;re <em>stateful</em>, remember?).   Double submit?  Ha!  Don&#8217;t even try!  Want to have a clean client redirect after performing some action, but still pass messages across?  No problemo &#8211; you&#8217;ve got a lightweight stateful conversation behind you.</p>
<p>By logically grouping your flows into SFSB&#8217;s, you can leverage more sophisticated failover because the container dirty-checks each instance and replicates automatically.  Try that with HTTPSession.</p>
<p>So, I will be doing a sandbox app soon with Seam, and I&#8217;ll post more as I know it.  Till then, read all you can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breddy.net/2006/06/13/seam-ejb3-and-gavin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

