Monday, October 24, 2011

Facelets, Includes, Templates and Custom Tags

So I've been working with Facelets on a project recently and had to understand the differences and similarities between includes, templates, compositions, custom tags and define/inserts.  Jacob Hookom made a great blog post about this.

An include is self-explanatory, it is as if the included code was right there in the including page.  This applies to all variables and backing beans as well.

A composition lets you compose a section of html with a template and defines/inserts.  More specifically, a composition can use a template for the majority of the structure and then make some defines to "fill in" the specifics of the template.  The define is matched to the corresponding insert (they have the same name attribute).

A custom tag lets you easily reuse a composition.

What I've taken to doing is using a custom tag that has some inserts in it, so I can just use the tag and a few enclosed defines to create what I need.  This lets me keep all conditional JSTL tags (if, choose) away from the custom tag implementation.

All in all, I'm really starting to like it.

Thursday, October 20, 2011

CDI Java Meetup

Greetings,

I was sick for a bit so there has been a recent lack of content.  Back to it then.

On Wednesday Oct 19 there was a Meetup at the Googleplex on Java CDI.  As a Spring guy myself (XML style too) it was interesting to see things done differently.  It seems interesting but not enough to get me to try to switch or play around with it.  Given that it's a standard I'm sure it'll be around, and there's a bridge to Spring too!

Thursday, October 13, 2011

Lambda's Coming to Java

You may have already heard, but Lambda expressions are coming to Java 8.  You can read the juicy (somewhat dated) post.  I have wanted this feature so many times.  Of course, I'm a Java developer who gritted his teeth through enough Lisp to miss the parenthesis for a couple of days.  I still wasn't impressed, but I "got it" as far as Lambdas go.

Wednesday, October 12, 2011

Thoughts on Architecture

I was recently reading up on architecture on Wikipedia, more specifically on Multitier Architecture.  This made me realize that a project I was working on didn't really have a presentation layer, the data went straight from the Data Access Object (DAO) to the UI.  Implementing a separate logic tier seems like a bit of a hassle, but we'll see how it goes.

Tuesday, October 11, 2011

Even in Engineering, It's the People?

I just came across this link at Java World that states that the problem with failed projects isn't technical, it's the people.  Specifically sometimes people are promoted to project manager when they don't have the managerial skills yet. Interesting.

Monday, October 10, 2011

Optimism Error

This post at io9 suggests that optimistic people have underactive information storing for "negative" information. It's been my experience that optimists do well when they team up with pessimists to get to an accurate prediction of how things will go.