Monthly Archives: June 2003

Joining the OFBiz Hibernate discussion

I’ve succumbed to the temptation of joining the argument about Hibernate and OFBiz’s Entity Engine.

Mike used the Entity Engine with JIRA. I have done a bit of hacking with it, and it hangs together quite nicely. That said though I think that WebWork and Hibernate would make for an even better match.

If you are Hibernating and then decide you really need to use EJB’s you could always swap them in. (you don’t really want to do without value objects do you?).

One of the cool things about Hibernating is that you get ctrl-space etc in ide’s.

Dynamic Typing is cool and all, but I like the idea of using an IDE to help me remember what attributes are available.

Here are some links in case you came in late.
Ofbiz EE: Forgotten but not forgiven
I’ve been biled – hahaha
OFBiz Persistence Revisited

Google/IntelliJ and Jakarta

We just had a need to push an input stream into a byte array.

I told the guy who was about to write the code to pause because people must have done this before.

A bit of a googling showed that StreamUtil was a common Utility class name(yeah, yeah util is a code smell). On a whim I went into IntelliJ and used the magic of <ctrl> <alt> space to check out if there were any Stream Utilish classes around (we have a number of jars in our tree due to dependencies etc)…. and found a copy of StreamUtil from here.

After going with IOUtil because that is the suggested way forward, we have a byte array from the stream with one line of code.

Nice.

Log4J coolness

I have been a great fan of Log4J since discovering it a few years ago. I am a proponent of the Don’t Use System.out.println! Use Log4j line of thinking. The problem has always been getting Developers to go along with it.

Today the technical lead of my project and I were talking about the problems with Logging, and he was suggesting that the cool answer would be to have a Swing client that read from a custom appender, allowing formatting of the output (colors etc), and dynamic display of messages. I thought, “yeah that’s pretty cool, I wonder if anyone has done it”? I went to the Log4J site and discovered LogFactor5.

It has great features (it meets all of the above requirements), and one of the best bits is that it is already a part of Log4J. just use the appropriate Appender, and you are set.

Open Source is great, isn’t it ;).

Minimising EJB

Tom is feeling Disillusioned with J2EE. Although it seems to be more of a disillusionment with EJB than anything else.

The good news is that it doesn’t have to be that way. He asks if people have been doing J2EE without EJB, and the answer (for me at least) is “yes”.

On my current project, and the one before, I have managed to win the fight against excessive EJB use. On my last project we used a basic templated SQL framework for persistence, without any use of EJBs at all (there were some decision makers concerned about the performance of OR mapping tools, which led to the decision of using the SQL templates).

On my current project we are using the OFBiz Entity Engine, which works well (wish they would decouple it from the rest of OFBiz a bit more ;)).

It has a single Stateless Session EJB that splits the application into web (Servlet) and Application (does db access, and has object caches) tiers.

On both projects external consultants suggested using a full blown EJB approach for reasons that didn’t really stand up to questioning, but a lightweight approach won in the end.

I am also writing a Struts/Hibernate/JDBC app on my own which fits the bill of a J2EE non-EJB app.