Sunday, June 30, 2002

You too can hear me say "ahhh" and "ummmmh" on Syscon radio from WebServices Edge

I ask the important questions like "is this on?".

Sean Rhody ask questions about the XP book, the new Python book and IBM developerWork's articles on EJB CMP/CMR and EJB QL and of course Trivera Technologies.

I spoke at JDJEdge. It went much better than I thought it would... (One of the advantages of being a pessimist)
I had the early early scheduled time slot to speak, and yet the attendance was still very high.

Tuesday, June 25, 2002

Extreme Programming Explained: Embrace Change by Kent Beck

I love this book. The first time I heard of this book, I thought my buddy was joking. The title conjured up images of programmer's jumping off bridges with laptops. Needless to say, I did not read the book then. Later, I read it, and I really enjoyed it.

My feelings are that this is a good book, but it is not complete. It introduces XP, but it is hard to apply XP with just this book. In my opinion, you need the book "Planning Extreme Programming" by Kent Beck, and Martin Fowler and this book to start really implementing XP. Don't worry, they are both small books and you could read them both in a weekend.

My observation about XP:

Pair programming is a tough concept to get and sell, but it can really help a team quickly grow in leaps and bounds!

Continous Integration (CI) and automated testing go hand in hand with refactoring. Without CI and automated testing you loose liquidity in your code base, and it is hard to add new features. Your project becomes rigid, and brittle without CI and automated testing.

Of course if you want to apply XP to Java.... You know what book I suggest!
I am redoing UML diagrams for our OOA/OOD course.
Not fun!

Tomorrow I will be a JDJEdge!

I am taking the red eye tonight.

Monday, June 24, 2002

The CMP/CMR tutorials are on EJB QL World!
I finally gave in.... All of the peer pressure about Eclipse, and all of the articles.
I am in the process of downloading it.
(Actually I downloaded it a while back and installed it, but never used it. This was on my laptop. Now I am doing it on my desktop.)

Saturday, June 22, 2002

Still need to work on the Resin or JBoss port.... I did convert the first EJB 2.0 CMP/CMR tutorial to PDF and we are going to hand it out. I copied it from the IBM's PDF to OpenOffice. Then coverted it to Word. All of the text was screwed up so I had to reformat the code listing and add back cr/lf and stuff. Kim made it look nice, and converted it back to PDF.

EJB QL World agreed to host the first two parts of the tutorial on their site. Yeah! I just need to finish converting it to HTML. I used Word to convert it to HTML and it looked like crap so I need to make it look neat. I also used OpenOffice to convert it to HTML and it looked worse in some ways... better in others. I am starting to prefer OpenOffice to MS Office. I think MS should be scared of OpenOffice.... much more so than Linux.

On Friday, I finished the slides for Agile/XP Universe. I started with the slides for JDJEdge... took out the stuff about XP theory and add more stuff about the using the tools. I added JUnitPerf, JMeter, and HttpUnit slides. I also added some more slides on Ant and more about JUnit. I also beefed up the Cactus sections. I created a collaboration diagram for Cactus to explain how the test runs on both the client and the server.

Wednesday, June 19, 2002

I took the UML test today on BrainBench. I was shooting for master level.... I missed it by 0.02 points.
I needed a 4.0 to get master level and I got a 3.98. Strangely, it is the 12th highest score in the United States of more than 750 people, and still not master level. I will try again in a few months. I think I will read UML distilled by Martin Fowler first.

I found this site useful for studying for the test. I also used the Larman book as well, and the UML spec.

Tuesday, June 18, 2002

Where can I find good Swing people?

Someone recently asked a good question... and it seemed like a good blog.

"Our team is looking for a very strong SWING engineer and honestly, this
hasn't been the easiest thing to find. Our backend is mod_perl for our web
sites and we're building a complex rich-client based on SWING. We want to
bring in a permanent employee in this
role as a senior engineer."

Its hard to find good Swing people. Part of the reason is the lack of demand for Swing, since Swing was so buggy in the past. Thus, developers that learned it did other type of development instead, and since there was no demand, it left a bad taste in their mouth. However, Swing is a lot better than it use to be!

May I ask what type of swing development do you plan on doing? e.g., Applet or Application?

If Application, you may consider SWT from IBM. The Eclipse project is built on SWT. SWT is more performant since it runs against more native code. Swing is a resource hog (although it is a lot better than it use to be). There is an article in Info World that you should read on SWT article on SWT Swing has some advantages as well. Swing has a really well designed API and framework. (I like Swing.)

If you are sold on Swing, may I suggest an alternative to hiring someone new. I find that taking a known quantity like a known good Perl developer and training them on Java and Swing is better (less risky) than taking an unknown quantity like a new developer off the street who claims to be a Swing expert. Plus variety is the spice of life and some of your Perl developers may want to learn something new. Good OO developers are good OO developers regardless of syntax. (For Perl developers you may have to do some training on OOA, OOD and OOP as well before you do Java/Swing training.)

If you do decide to hire someone off the street, make them take the Java GUI brainbench test, and pass it at the master level. This will not prove that they are a good developer, but it will show that they at least know about Swing. Always get good references. And if you know anyone that knows swing and Java, have them help you with a tech interview questions. In the past, when I want a developer with a certain skillset, I would not even interview them until they passed the brainbench exams.... this saves time and weeds some people out straight away.

Also, let me know if you ever want to switch from the Perl Mod world to the JSP, TagLib, Servlet world. Resin's fast Servlet 2.3 and JSP 1.2 engine beats mod_perl, mod_php, and other servlet engines in performance benchmarks. I like LAMP. I helped an organization switch from LAMP to J2EE.

Triveratech specializes in J2EE training. We also have Java and Swing course that may help you out.
EJB QL + EJB Local + XDoclets = more EJB on more projects

I have recently read a lot of articles about whether or not developers should use EJB.

The argument against EJB tends to be that they are too complex. This is ironic since EJB's purpose was to simplify server-side development. Don't get me wrong... I agree EJB is too complex with for a lot of projects, and that a lot of project could have gotten away with just Servlets and JSP. Too many developer's were using EJB to add an extra bullet on their resume. While I agree that EJB is not for every project, I think recent advances in tools and techniques equate to EJB being more applicable to more projects.

Of particular interest in developer productivity with EJB is CMR, EJB QL and XDoclet (EJBDoclet). Basically, the productivity and utility of these tools have to exceed the inherent difficulties in using EJB in order for EJB to be considered on a project. These tools lower the bar while increasing the utility and make more projects candidates for EJB.

XDoclet, and open source project, simplifies EJB development by using JavaDoc API and some additional APIs as a code generator so that a developer only has to maintain one file instead of 5 or more files (,i.e., deployment descriptor, local interface and/or remote interface class files, local home and/or remote home class files, vendor deployment descriptors and/or conf files, bean implementation, primary key class files, value class files and more.)

There is a significant increase in productivity by using select methods and EJB QL. Code that use to take 10, 20, 30 lines of code can be written in just a few lines of code by mastering EJB QL.

When you combine XDoclet simplification with EJB-QL and CMR, you can use EJB on a lot more projects.

With CMR it is really easy to work with the standard collections API (which we all know and love) when dealing with one-to-many and many-to-many relationships between entities.

EJB 2.0 specification has been out for a while. Have you tried the new features like CMR and EJB QL? If so, what do you think?

My personal experience is that finder and select methods (written in EJB QL) are really productive and can save a lot time. Is EJB QL the killer tool?

If you have not tried CMR or EJB QL, I wrote a tutorial on CMP/CMR and EJB QL that I think you should check out. The tutorial is on IBM developerWorks. Please go to this link to find out more information on this tutorial series and related articles.

The free tutorial is broken up into four parts.

The first part describes basic EJB 2.x CMP with a simple finder method defined in EJB QL.

The second part describes defining EJB CMR relationships. Three types of relationships are covered:

  • Many to Many

  • One to Many

  • One to One

Both unidirectional and bidirectional relationships are covered.

The third part describes basic EJB QL. It mostly deals with joining cmr fields and working with IN and MEMBER OF.

The fourth and final part describes advanced EJB QL, and how to create select methods. The tutorial refactors code using the select methods and show a 10x reduction in code. (And gives directions how to rewrite a method from the earlier examples with a 20x reduction in code.)
Master select methods and you will love EJB QL!!

You can download the PDF files for the tutorial from developerWorks and view the tutorial offline. Or you can view it online. (see the links above to developerWorks)

Parts 3 and 4 are done. They should be out really soon. They have been bounced back and forth a few times between me and the editor. There is also an article in the works on XDoclet and EJBDoclet (more on this later).

The code in the first two parts works with Sun's RI for J2EE (RI is the reference implementation). Peter Luellen from West Side Widgets created the deployment descriptors to get final code from part 1 and 2 working for JBoss. (JBoss is an open source EJB application server.)

The code in the last two parts of the tutorial were done in WebLogic. The code will run on JBoss, Resin and more shortly. Check back at my site to see code updates to other app servers, and to see if the XDoclet article has been published. (Also if you would like to run the examples on your favorite app server, and send the configuration and/or code updates, I will glady accept them. Send them to

The code in the last two parts uses XDoclet, and makes a good example of how to use XDoclet to setup CMR relationships and write finder and select methods in EJB QL.

Initial try to get Resin EJB to run against tutorial example

Okay, okay, okay, I have been waiting for the EJB Doclets for Resin. Now they are here… yeah…. I downloaded it last Wednesday, and now its Tuesday the next week. I’ve read through the docs but got so busy with the Python book I had to stop for a while.

Step1: Went to and downloaded the EJB Doclet support.

Step2: After you download the jar; extract and read the notes.txt. The notes contain the names of all of the javadoc tags for the Resin EJB Doclets.

Step 3: Run the build script with ant. If you don’t have xdoclet.jar on classpath then you will have to set the xdoclet.jar=/usr/local/src/ejb/xdoclet/lib/xdoclet.jar to where you have xdoclet.jar. (It was on my classpath so it worked for me with no mods…).

Step 4: Next I copied the resin-xdoclet.jar to my ant lib:

copy c:\resinxdoc\dist\resin-xdoclet.jar c:\ant\lib

Step 5: I modified the build file for the example and added the following:
to the ejbdoclet target (). I added the within the body ejbdoclet task. Seems straight forward, but it did not work. It complained about this not being a subtask of ejbdoclet or some such. (Later I noticed that this was mentioned in the notes.txt.)


classname="com.caucho.xdoclet.ResinEjbDocletTask" classpath="${xdoclet.path}"




Note: I got to the beginning of step 5 and then my wife and kids came to town so they can see New York too. They cruised the city while I worked. Thus another 4 to 5 days my pet project sits on the shelf. On a lighter note, I did get to see the Bronx Zoo and the Empire State building, and spend some quality time with the family. You will notice the absence of blog entries that denote their arrival.

Now step 5 is not working, when I get back online (I am currently on a plane returning to Tucson from NY), I will send some emails, and see if anyone else got this to work and while I am waiting I will dig into the resin xdoclet source code. I wanted an excuse to learn more about xdoclet internals anyway; now is my excuse to dig in.

Step 6: Add the javadoc tag to the source code. For this step, I followed the notes in the notes.txt. The notes.txt file is in the root of the file that you extract. I performed this step but nothing happened. I got a big fat zilch. Worse yet, I did not get any error messages when I ran the resingen task. See the notes for step 5 for more detail.

What have I learned from looking into the source file….

First the DD that does the mapping will be in a file resin.ejb by default.
I am getting the gist, but still not sure about all of the details.
It seems like maybe… just maybe it can’t find the *.j files, which are class resources.
I put the resin xdoc jar on the classpath…. Still nothing.

set classpath=%classpath%;c:\ant/lib/xdoclet.jar;c:\ant/lib/log4j.jar;c:\ant/lib/ant.jar;c:\ant\lib\resin-xdoclet.jar

I think I figured it out while I was offline. I think I need to use the substask resinejb of resinejb. Anyone it was fun digging into the templates.

The folks at EJB QL world wrote back and said they would be interested in the first two parts of the EJB tutorial. Now it has another home.

I posted links to the tutorial page on my site on JavaLobby, JavaChannel, JavaRanch and SlashDot. I made posting on slash dot differnent to suit their unique style.

Rawn from IBM developerWorks wrote back and now they want a tutorial on XDoclets.

Wednesday, June 12, 2002

Last night I started working on testing the sample application for the EJB tutorial on Resin.
I started to use the XDoclets for Resin. I did not finish due to an unexpected visitor.
Hopefully, I can sneak some time in tonight. I want to port/test the sample application to Resin and
JBoss (part 1 and 2 already work on JBoss) so I can start on my next pet project jysp (Jython Server Pages).
More on tihs later.

Before I started working on testing the EJB example with Resin, I asked the folks at if they wanted to cohost the tutorial since they did not have one yet.
No word from them.

I want to create JYSP.... Jython Server Pages. I have been thinking about it a lot.
It would consist of two things:
1) An Ant task that takes *.jysp files and converts them into Jython based Servlets.
2) A Servlet that has *.jysp files associated with it. The Servlet (the JYSP engine), would check to see if the jysp file has
already been generated, if not it would generate the file and then compile it with jythonc.
This will be my next pet project after I finish the other.

Tuesday, June 11, 2002

This is my very first blog. I am in NY this week teaching an OO analysis and design course.

I got interested in blogging after reading the "Is Tomcat Crap?" blogs. We did similar benchmarks, and got similar results when I worked at eBlox, but never shared them with the world. Ahhhh.... the power of blogging.

While in class a student showed me Scott Ambler book "The Object Primer". I flipped through it. It looks really good.
I like his Agile Modeling book.

I spent a few minutes today working with Joshua Fruhlinger. He is a contract editor working for IBM developerWorks.
He had a few queries about part 3 and 4 of the four part tutorial on EJB 2.0 CMP/CMR and EJB QL that I wrote for developerWorks.

If I get sometime tonight, I am going to work on porting the code examples from part 3 and 4 to work with Resin enterprise. The code examples for part 1 and 2 has already been ported and tested with JBoss thanks to Peter at West Side Widgets.

Okay.... well this is my first blog so I will keep it short.