In this post I will share my recent findings about Container Dependency Injection in Java EE 6, in particular how to decouple the processing threads of event producers and event consumers.
Java EE 6 introduces a very nice dependency injection framework (CDI) that has superb support for the Observer pattern in the form of event broadcasting.
An Event in CDI is just a regular POJO:
on Apr 14, 2010
What it means to speak German fluently and to be able of C++
Several years ago one of our key coders moved from the south of Germany (where our HQ is located at the Black Forest) to the cold and rainy north, so we had to to find a suitable substitute. After screening lots of applications, we picked few to invite for an interview. It declared the candidate's ability to speak German and C++. So she...
on Feb 20, 2010
The image on the left is a screengrab I
took when I was reviewing content for my upcoming book, with Neil
Griffin, JavaServer Faces 2.0: The
Complete Reference. I consider this little snippet an atonment for
the HTTP violations of JSF versions past (before I was spec lead).
Sorry about that.
For the record, the article referred to in the book is at <http://www.theserverside.com/tt/articles/...
on Oct 8, 2009
A couple of years ago, at OOPSLA '06, I think, I had a lot of fun hanging out with Jarda Tulach and Rich Unger and writing a generic library for enqueueing a batch of jobs that run against an object on a background thread.
The fun part was really getting to dig into the java.util.concurrent classes, to do it such that enqueueing work is always non-blocking and transparently handles scheduling of...
on May 5, 2009
A few of months ago I blogged about a simple but powerful pattern for working with Objects not key/value pairs - use dynamic proxies to generate an implementation of an interface, which delegates to the backing storage transparently. It's ready to become a small open source project.
Names are important — they should either be communicative and say what a thing is/does — or they...
on May 5, 2009
One pattern that is an incredibly frequent recurring theme is converting an Object of type A into an object of type B for something that understands B to consume. Tons of libraries have something like this embedded in them - beans binding, pretty much anything that validates strings. If there were ever something that deserves a simple common library, it's this.
I was just looking at Fabrizio...
on May 1, 2009
For a while I was desperately expecting an important moment. Since I wrote the Practical API Design book, and since its amazon page was created, I've been waiting for first customer review. Almost daily, at least at the beginning, I was watching whether it had already appeared or not. I always opened the
book's page being afraid of what I would find. I feared to see something like unreadable,...
on Jan 19, 2009
Happy New Year 2009
I am late on wishing you, still I have got some exciting stuff for all..
Dec 24, 2008
I began another blog series, the most interesting one I guess! As part of my university courses, where I was introduced to "Gang of Four" design patterns in recent past. I felt quite excited about them, so lets see whatâ€™s in store for all of usâ€¦
Jan 02, 2009
As per the above announcement...
on Jan 9, 2009
There is one thing that I've overlooked until today, which is the importance of the division of the controller into application "flow(s)" and application "service(s)". For a good while now, I had been keeping controller code separate from service code (which in turn called the DAOs, that used Spring DAO, that used Hibernate, that interacted with the DB, etc.). However sometimes business logic...
on Dec 5, 2008
A few months ago I wrote a blog about javaspaces and its (lack of ?) popularity. The blog fuelled an interesting debate.
Yet, some of my concerns remained unanswered. Surely if Javaspaces technology had acquired more popularity by now,
many space based patterns and techniques would have been described over the internet.
Today, I will embark myself in such a task and attempt to describe a...
on May 12, 2007
First of all, thank you everyone for being present at our session TS4721, I took some pictures of you guys (almost 1700 people) to prove to my boss why it is really important to speak at JavaOne. Of course it is a joke, my boss really knows how important it is.
Fabiane and I really worked hard to deliver as good as possible of a presentation, because we respect individually any person in the...
on May 9, 2007
I recently attended a
JUGS meeting where Prof. Nierstrasz introduced some
details about his new book, titled Object-Oriented
Reengineering Patterns. Very interesting lecture based on a project that aims to research and to produce
tools for supporting the refactory of legacy code. Professor started asking the attendants
what you mean by legacy code? and also presented some basic concepts about...
on Jan 25, 2007
Weakly typed sudo java delegate implementations seem to be a dime a dozen these days. After reading the latest article on JDJ http://sys-con.com/story/?storyid=49097&DE=1 about yet another weakly typed implementation for java delegates I decided it was high time to put my brain to work on implementing strongly typed delegates. With a little imagination and some magic it was quite simple,...
on Apr 11, 2005
Time flies... Can you believe it's been ten years since Design Patterns was written and published by the Gang of Four? If you're not familar with this book, you should be: Design Patterns: Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson, and Vlissides (affectionately known as the "gang of four") introduced the world to the idea of creating reusable, general OO designs that...
on Oct 27, 2004
Let us start with a need
Given a user name, userid and an email address create a user. We can call this "createUser" transaction with three parameters name, id, and email.
Let us see how a client can invoke this horizontally
Conceptual horizontal invocation using key value pairs
client -> calls -> execTransaction(requestName="createUser",name="", id="", email...
on Jul 17, 2004
While preparing for an upcoming session at OSCON 2004, I have collected some sample code for dealing with factory patterns in java applications. The specified URL lists some demonstrative examples of the idea. The examples deal with simple object instantiation, simple object instantiation using IMultiInstance, simple object instantiation with parameters, simple object instantiation with...
on Jul 14, 2004
While preparing for an upcoming session at OSCON 2004, I have collected some sample code for dealing with configuration in java applications. The specified URL lists some demonstrative examples of the idea. The examples deal with XML configuration files, Property file configuration files, Reading mandatory keys, Providing default values, Reading objects from configuration files, Configuration as...
on Jul 13, 2004
I have been trying to summarize and document some of the server side programming/design patterns I have used while building Aspire/J2EE/XML. I am quite happy to see the idea come to fruition as it was accepted as a session at the upcoming (very soon) OSCON 2004 to be held in Portland, Oregon. The presentation covers application patterns, data access patterns, business logic patterns, presentation...
on Jul 7, 2004
Working with ServletRequest's setCharacterEncoding for UTF-8 form submissions
Aspire, the product that I developed over the last few years while I was working with java, servlets, jsp and XML, is being used on some SBIR projects involving JetSpeed and a few other open source tools. I have got a call the other day indicating that one of the forms is not accepting Vietnamese input. They are getting...
on May 21, 2004
City of Heroes Update
Well CoH has launched and I've been playing for a few weeks. Here's my rundown of the game so far.
I have to say I'm very impressed with CoH. Although it has some pretty severe limits they've done an awful lot of things right.
One of the first things you notice on entering CoH is the vast array of choices for your character's look. I really have yet to see 2 players that...
on May 10, 2004