Adam Bien's Weblog

Thursday Jul 08, 2010

A Day In Paris (JUG) With Java EE 6

Back from JUG Paris. It was almost a conference (~200 attendees). It was my first time in Paris -> I really like the city. Although I was said to got some competition by the football world championships, the room was packed.I predicted France to become the football world champion (I'm a true football expert :-)) - the attendees liked my expertise in this area.

I started with slides and ended in the IDE. What I really enjoyed - was the amount of good questions (from AOP, to SmallTalk). The situation escalated in the breaks, where some attendees asked me several questions at the same time concurrently. These questions were the best.

In the last part I build a JUG Management System with CDI, EJB 3, JPA, REST (JSON+XML), a bit security, Servlets and in the last two minutes I introduced JSF 2. Because of time, I started to answer questions in the IDE :-).
After the session we spend about 2 hours in restaurant and another 2 hours in a bar - still discussing Java EE, Clustering, Failover, scalability, private / public Clouds Java, even JINI. We discussed 98% Java and 2% private stuff (like the relation of a freelancer to vacations :-)).

Paris JUG is really well organized - and all participant seem to have lots of fun. Really enjoyed that. Already looking forward to SophiaConf in Nice. What also interesting - there is a female group of Java Hackers in Paris. This could be the beginning of a female Java Champions division as well.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Friday Jun 25, 2010

Java FX CSS Reference Available

The appearance of UI-Controls in Java FX can be either configured programmatically, or with CSS. See this comprehensive CSS reference. Hopefully it will be distributed with the official SDK doc in the next release...
Its a kind of "Convention Over Configuration" again :-).


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Monday Jun 21, 2010

EJB 3.1 + Hessian = (Almost) Perfect Binary Remoting

EJB 3.1 + REST are perfect combo for HTTP and resource style programming. REST is not very well suited for the exposure of already existing interfaces. The RPC-misuse of REST will result in hard to understand and so to maintain code.
With hessian it is very easy to expose existing Java-interfaces with almost no overhead. Hessian is also extremely (better than IIOP and far better than SOAP) fast and scalable. The size of the whole hessian library (hessian-4.0.7.jar) is smaller than 400 kB and so compatible with the "Kilobyte Deployment" style of Java EE 6 programming and deployment.

To expose an existing EJB 3.1 with hessian:


@Stateless
public class CurrentTime {
    public long nanos(){
        return System.nanoTime();
    }
}

You will need an interface:

public interface TimeService {
    public long nanos();
}


...and hessian-specific implementation of the endpoint:


public class HessianTimeEndpoint extends HessianServlet implements TimeService{
	
    @EJB
    CurrentTime currentTime;
	
    @Override
    public long nanos() {
        return currentTime.nanos();
    }
}


The hessian enpoint is an servlet - so the dependency injection works here without any XML configuration. You can just inject your no-interface EJB 3.1 view bean into the servlet.
The client side is also very lean. You only need a two lines of code to get a reference tot he proxy:

public class HessianTimeEndpointTest {
    private TimeService timeService;
	@Before
    public void initProxy() throws MalformedURLException {
        String url = "http://localhost:8080/EJB31AndHessian/TimeService";
        HessianProxyFactory factory = new HessianProxyFactory();
        this.timeService = (TimeService) factory.create(TimeService.class,url);
        assertNotNull(timeService);
    }
    @Test
    public void nanos() {
        long nanos = this.timeService.nanos();
        assertTrue(nanos>0);
        System.out.println("Nanos: " + nanos);
    }
}

HessianServlet inherits from GenericServlet and not from HttpServlet. This is a shame, because you will have to use a web.xml deployment descriptor, instead of a single annotation @WebServlet:

<web-app >
    <servlet>
        <servlet-name>TimeService</servlet-name>
        <servlet-class>com.abien.patterns.business.sf.hessian.HessianTimeEndpoint</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>TimeService</servlet-name>
        <url-pattern>/TimeService</url-pattern>
    </servlet-mapping>
</web-app>

You will find the executable project (tested with Netbeans 6.9 and Glassfish v3.0.1) in: http://kenai.com/projects/javaee-patterns/ [project name: EJB3AndHessian].
The whole WAR (EJB 3, Servlet, web.xml and the hessian "framework") is 393 kB. 385 kB hessian, and 7 kB EJB + Servlet :-)


The initial deployment of the WAR with EJBs took:

INFO: Portable JNDI names for EJB CurrentTime : [java:global/EJB31AndHessian/CurrentTime!com.abien.patterns.business.sf.CurrentTime, java:global/EJB31AndHessian/CurrentTime]
INFO: Loading application EJB31AndHessian at /EJB31AndHessian
INFO: EJB31AndHessian was successfully deployed in 807 milliseconds.


Don't worry: the subsequent deployments are substantially faster :-):

INFO: Portable JNDI names for EJB CurrentTime : [java:global/EJB31AndHessian/CurrentTime!com.abien.patterns.business.sf.CurrentTime, java:global/EJB31AndHessian/CurrentTime]
INFO: Loading application EJB31AndHessian at /EJB31AndHessian
INFO: EJB31AndHessian was successfully deployed in 568 milliseconds.

[See also Service Facade pattern, page 69"Real World Java EE Patterns - Rethinking Best Practices]


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Monday Jun 14, 2010

A French And Free Java EE 6 Week - Some Slides, More Code

The free Java EE 6 events in the week of 05.07-09.07.2010 will start at July the 6th in Paris. I will give a (hopefully openspace-like / interactive) presentation with the title Lightweight Killer Apps with Nothing But Vanilla Java EE 6.

In the same week I will give a releated presentation Java EE 6 - Leaner Than POJOs in Nice.
Java EE 6 is so lightweight - that it may look overly complicated on slides. For that reason I will spend the majority of the time in the IDE. Hope it is o.k.
Thanks for the invitation (and sorry for the rollbacks in the past)! I guess I'm the only speaker with a truly french last name - but without any capability of speaking french :-).


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Saturday May 08, 2010

How Popular Is Actually Java EE 6?

I'm back from the JAX 2010 - one of the biggest european Java conferences. There was lot more interests in Java EE 6, than expected:

  1. The "Simpler? - Is Impossible - Java EE 6" Workshop was fully booked - with 75 reservations. The actual number of attendees was approx. 100-150. Even the repetition at the very last day was well attended (12-20 attendees I had far more attendees at the end, than at the beginning :-)).
  2. The "60 Minutes With Java EE 6" talk was also well attended - it took place in one of the biggest rooms (the keynote room).
  3. We got a table with the topic "Weightless Beans" for the open space part of the conference. Because of the number of attendees, we had expand to the next table near us - and had a lot of fun and nice conversations about Java EE 6 (EJB, CDI, JPA) and the craziest errors in production.
  4. Java EE 6 trainings are almost sold out. I increased the max-number of attendees to 20.
  5. We asked the audience after our (Peter Rossbach, a Tomcat-Committer and me) Tomcat + openEJB session, who would be interested in a Tomcat+EJB distribution. More than half attendees were interested.
  6. Several conference attendees reported me that they are in the process of migration to Java EE 6 ...from Java EE 5

JAX was really nice conference with great food and interesting topics. Already looking forward to W-JAX! Thanks for attending the workshops, sessions - your feedback is highly appreciated.

 


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Sunday Apr 18, 2010

Gosling's Thoughts On "Next" - Oracle, Lawyers And Fun

...One of my personality quirks that makes my "what's next" question more difficult is that most of the things that interest me are science projects rather than sensible business plans. I'll be having fun....

Read the whole post.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Thursday Apr 15, 2010

SOA Is Not Dead - Deutsche Bahn (DB) Is Highly Decoupled, HA, Service Oriented and Implementation Agnostic

I tried to make a sit reservation for an ICE (a nice train - perfectly suitable for hacking or writing). Because I travel a bit, I'm a bahn.comfort customer - its something like frequent flyer.

To make the reservation, the DB-clerk ask his colleague to get a phone and called the bahn.comfort line. It took about 5 minutes, because the line was busy. He made the reservation, go an ID and wrote it down on paper. Then he put the ID in his application and printed my tickets. I ask him why he just didn't used the computer - he answered: "Its a premium service - without a call it would be too easy".
Thinking about that from the software perspective - its genius:
  1. bahn.comfort service is location agnostic: the implementation of the service on the other side (another clerk), could sit whenever he want. I even suspect he was in the same room :-)
  2. The interface (=phone) is very generic. Everything is replacable - even the telephone-device.
  3. Built-in throughput throttling: there was only one shared phone used by three clerks (what I observed): the guy (a singleton) on the other side couldn't be overloaded.
  4. The whole process is highly available: the clerk who called the bahn.comfort service tried to reach someone several times until the eventual success. He also wrote down the ID on paper (this can be considered as TX log or persistent message). Now the clerk itself is replacable, another clerk could just complete the process having the Id
  5. The whole process is consistent: I stayed in touch with him and could react to any system-exceptions (like busy line). There is no need for rollbacks or compensative transactions, because he could ask me (the end-user) how to further proceed
  6. Cloud ready: partially it seemed like the clerk tried to reach someone in the clouds :-)

With this genius approach, most of the challenges, described in my How To Kill A SOA Project post are not only addressed, but entirely solved :-)
Now I'm in the ICE - with a ticket bought in highly service oriented way and enjoy the ride.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Tuesday Apr 13, 2010

Upcoming Java EE 6 "Kill The Bloat" Workshops

  1. Java EE 5/6 Patterns in Hamburg (26.04-30.04.2010) - some (3-5) places left
  2. 60 minutes with Java EE 6, 04.05 at JAX conference - this should be fun. I will hack a Java EE 6 application in 60 minutes on stage. Still no idea which one - but suggestions are highly appreciated. I will use Java EE 6 - and so less slides, than last year for explanation (Java EE 6 is even simpler, than Java EE 5) :-).
    *After the session*, we will discuss Java EE 6 / EJB / JMS etc. features, problems and workarounds during the "open space" part at the JAX conference. Watch the table "Weightless Beans" in the Ballroom.
  3. Simpler is Impossible. From UI to Integration Layer with plain Java EE, 03.05.2010 (at JAX Conference)
  4. End 2 End Java EE 6 in Munich (07.06-09.06.2010) - this one is almost sold out

Caution: we spend usually more time in the IDE, than with slides (reason: slides don't crash :-)). I tend to explain stuff with code. I also usually have > 100 slides prepared - for warm-up purposes :-).
I will probably offer another workshop in autumn - because of current (Java EE 6) project / request load, I'm still searching for a free slot.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Sunday Apr 11, 2010

GlassFish will be Killed, Closed Source, Children's Edition And The Official Response

Oracle's official GlassFish roadmap (also clustering, HA and Java EE 7, GlassFish v4) summarized on 14 slides. The excellent Java EE 5/6 portability (vendor-neutrality) story and this slide deck should give GlassFish the next popularity/adoption boost.
[I borrowed the title from slide 4]


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Saturday Apr 10, 2010

James Gosling Leaves Oracle

It's sad, but James Gosling leaves Oracle. I'm really curious about his next job...
An excerpt from his bio: "...He briefly worked for Oracle after the acquisition of Sun. He is now blissfully unemployed :-)..."


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Meta-stuff / Interviews
My Recent Book
Java One 2009
CommunityOne East N.Y.C
JavaONE 2008 Interview
Search
...the last 150 posts
...the last 10 comments
greenfire.dev.java.net
Links
my.netbeans.org
Visitors
License