Skip to main content

TS4721 Done! And some new stuff we will show at JavaOne 2007

Posted by edgars on March 21, 2007 at 1:56 PM PDT

Doing our presentation for JavaOne, Fabiane Nardon and I, we had several points about what we could put on slides. Unfortunately, we can't put everything we already done using EJB3, because we have only 1 hour to speak. This post shows some stuff we decided take out from official presentation.

Patterns out from Presentation

When we decided to show new Design Patterns, the main idea was to show which patterns still are on the shelf, and which are not so necessary. If you would like to learn new tricks and design patterns for EJB 3, you should consider attending this JavaOne2007 session TS 4721 - Implementing Java EE Applications, Using Enterprise JavaBeans (EJB) 3 Technology: Real-World Tips, Tricks, and New Design Patterns, so we selected only real good new design patterns, and then some of what we expected as new Design Patterns, are not so good, however, I can publish them here, and maybe I can hear some opinions. The first one is Load Data Decorator.

Load Data Decorator


After to load or update data, maybe you want to check the value and change it for presentations issues.


Use also Life Cycle Callback Methods for Entities

Look the following example:

@EntityListener (AtendeeEmailDecorator.class)
public class Atendee implements Serializable{

Basically you register a class to act as a listener for this Entity. Check this class in the following code listing:

public class AtendeeEmailDecorator {
    public void evaluateEmail(Atendee atendee){
       if (atendee.getEmail().indexOf("@")<=0) {
          atendee.setEmail("Email contains errors!");

Now, if you want to present this information into a dataTable using JSF as Client View tier, the correct information is ready to be presented.

Maybe you can agree with us, and you could remove it too, or anybody else can look to this, and use it as good solution.


Related Topics >>