Apr 30

Standards Committees are a Really Bad Place to do Research

Tech 1 Comment »

Jorgen Thelin (Microsoft) and Tim Bray (Sun) are talking about how standards are terrific when applied to proven industry practice but high-risk in the domain of theory and science.

I definitely agree. If we take a look at the JCP what are the stars, and what are the dullards?

java.util.concurrent

This bad boy came out of the great work and experience of Doug Lea and his concurrent package. It evolved, it was proven in the real world (which Jorgen likes), and was then just fine-tuned in the standards process. In fact it gave Doug a chance to take his experience, but also “start again” and clean house.

Java 1.4 Logging

The de facto standard at the time was Log4J. However the JCP seemed to ignore that and make their own thing. Log4J even had to change to look more like the jdk 1.4 logging API!

JavaServer Faces

We had Tapestry, Swinglets, and other technology which wasn’t looked at as closely as it should have been.

In JDO 2.0, we have a chance to LEARN from our experiences with JDO 1.0. Vendors have real users, with real needs. Users are on the expert group too…. asking for their pain points to be resolved. Hopefully this will make the outcome more of a success than anything else. But then again, what will EJB 3 do to JDO? We will find out more next week!

So, lets standardize after the fact… follow proven technology, which is working in the real world. Then we will have great standards, that do their job.

Apr 30

Bubble Tea: The new rage :)

Personal 5 Comments »

I love living in an urban-ish area. There is a small asian tea shop called SweeTea, near Porter Square in Cambridge, MA.

They sell Bubble Tea, which I had for the first time today. How do I explain it…. well, take an iced green or black tea, add some flavour (e.g. mango, pineapple, [insert fruit]).

Sounds refreshing at this point… but what is special about it. For that my friends… you need to take a wide straw and suck. You will then get the surprise of the bubbles. These are small squidgy balls. Tapioca black pearls, or maybe lychee. You can also get grass jelly or choobees whatever they are! (have to try next time).

The reason that I heard about this was via Emily. She was turned onto it by a friend from Singapore. Apparantly it is all the rage there.

Try one in your area today! Savour the bubbles :)

Apr 30

Java Certifications

Tech 6 Comments »

Dan Moore asked What use is certification?.

They are not implicitly bad, however I am not a huge fan of them as they exist right now.

  • The programmer exam tests your memory skills (reminds me of some of the standard exams back home in England ;)
  • The architects exam is better, in that it is more portfolio based. You build a real enterprise application, and gain experience doing so. The only problem with it is that you have to do the UML, and follow the blueprints ;)
  • I have never used the fact that I am certified, and noone has ever cared

A few people have told me that they want to get certified as a way to push them up the stack, and to help against outsourcing. For these people, you have to realise that there are a lot of developers in India, eastern europe, asia that are certified, and going to be certified.

To fight that war you need to think about what skills are needed for work RIGHT HERE. Maybe learn some high risk / high reward skills. Again, if you really want the certification… knock yourself out…. but in my experience the currency is less that 1 rupee.

Apr 29

Google: Good luck to you, I feel your pain for being public

Google, Tech 1 Comment »

So, Google is on the path to IPO.

I really wish the best for them because:

a) I like Google
b) A lot of people are watching. If the do well it bodes well for the tech sector, and if they don’t…..

It will be very interesting to see how Google changes. Being public is a royal pain in the butt. Now you answer to your share-holders and the street. Now people will be poking and proding.

I am sure they can handle it (hey there are lots of successful public companies!).

Good luck guys.

Apr 29

RE: Weather.com: WebSphere to Tomcat and Oracle to MySQL

Tech 1 Comment »

Matt has an interesting entry on Weather.com: WebSphere to Tomcat and Oracle to MySQL.

This is a very interesting trend. I think for many applications that it is going to continue to grow too.

Most applications are not enterprise applications. Don’t confuse “An application running within an enterprise” with “an enterprise large scale application”.

NASDAQ’s trading system is a large scale enterprise application.
The internal resume system within IBM is just a system that runs within a large enteprise.

For this, and other reasons (the new movement to lightweight containers, and TDD) we now find ourselves not needing the like of EJB. That is why I asked Are there many use cases for choosing JBoss Server?.

Although this makes sense from a technical standpoint, it is good to hear stories like Weather.com, as this shows that management is getting it too. They are always behind… but it is good to hear that at least some of them don’t think they need EJB :)

Now we can get to “the simplest tool for the job”, and more complex projects will require more tools to help you out.

Apr 29

Geronimo team announces the first milestone: 1.0 M1

Tech 1 Comment »

There was a lot of buzz when Apache announced that they were going to work on a J2EE certified application server. After the buzz, the developers put their heads down and got to work. At ApacheCon they had a session at the bar (mostly coding I think ;) which resulted in PetStore running as a demo.

Today they released their first milestone: M1

Geronimo 1.0 milestone build M1 released

We shouldn’t expect to download this bad boy and have the experience be like installing BEA WebLogic 8.1 or anything, but it is good to have something out there.

Now the Geronimo team can “do an Eclipse” and come out with new milestones which totally break the ones before ;) jk

Congrats guys.

Apr 28

CoHiki: Tangosol Wiki

Tech No Comments »

I had the pleasure of being at the unveiling of Tangosol Cohiki. If you need a wiki that is available 24×7x365 this is the Wiki for you.

It will be powering TheServerSide in the coming months.

Read more in Cameron’s blog entry

:)

Apr 27

End of the Knowledge Worker?

Tech No Comments »

Dave Thomas (Pragmatic Programmer) gives a talk called “Herding Racehorses, Racing Sheep”. I had the pleasure of listening to his talk at the recent No Fluff.

If you haven’t seen Dave talk, you have to at some time. I mentioned that I liked Stu’s style, as he has ~5 slides, and just opens up his IDE and starts coding.

Dave has a different style. His talks are higher level (no code) and he just gets into a flow on the topic. The slides are just kinda there in the background.

If you have seen The Daily Show (and why aren’t you if you haven’t!)…. you know when a funny blurb is shown in the top left corner while Jon Stewart gives the news? It just makes you laugh… and is a side piece compared to Jon’s words. Dave often has slides which have the same affect. It is highly entertaining, and the topics are important to ANY type of programmer.

Dave has written up some key points from his talk, which focuses on different roles that we are in as developers on a particular topic (Novice -> Expert). If you are worried about outsourcing, you will want to make sure that you are skilled in a way that you are high up on the scale. This scale is the Dreyfus Model of Skill Acquisition, and was used in the nursing profession first.

Software development needs to shape up as a profession. Read End of the Knowledge Worker? to learn why.

Apr 27

New Groovy “use” method added by Sam

Groovy, Tech 1 Comment »

Sam Pullara has added a cool new feature to Groovy. There is a new method use which allows you to introduce methods to existing class.

At the moment this works just for the duration of closure, but in the future you will be able to use it elsewhere.

This is pretty cool. I also would love to see:

  • Feature plugin/out: It would be great to use this mechanism to allow “features” of the language to be plugged in and out. It could enable backwards compatibility in the future, allowing changes to the language as experience shows us what to do (one worry wrt standardizing before a real impl is out there!)
  • Flush out AOP-isms: Mixin’s are great, but I would love to see a PointCut language, and rich support

From Sam’s Email:

excerpt from src/test/groovy/xml/dom/DOMTest.groovy:

xml = new StringReader(”<html><head><title class=’mytitle’>Test</title></head><body><p class=’mystyle’>This is a test.</p></body></html>”);
doc = DOMBuilder.parse(xml);
html = doc.documentElement;
use (groovy.xml.dom.DOMCategory) {
assert html.head.title.textContent == “Test”;
assert html.body.p.textContent == “This is a test.”;
assert html.find { it.tagName == “body” }.tagName == “body”;
assert html.getElementsByTagName(”*”).findAll { if (it["@class"] != “”) { return it } }.size() == 2;
}

Apr 26

Feeling Groovy again

Groovy, Tech 2 Comments »

Ahh, some of the old feelings are coming back. I was on the phone with someone… asking me if I could put together a program that munged some database data and split it out into a file.

I would normally use Perl, but I am feeling Groovy at the moment. So, as I was being explained the problem at hand, I opened up a new file and got to work.

At the end of the explanation, when asked “when could it get done by?”, I was able to say “how about now?”.

import groovy.sql.Sql
import java.io.File

sql = Sql.newInstance(”jdbc:postgresql://dbhost/dbname”, “user”, “pass”, “org.postgresql.Driver”)

new File(”mungeddata.log”).withWriter { writer |
writer.writeLine “Foo, Bar, Baz”

sql.eachRow(”select foo, bar, baz from thetable”) {
writer.writeLine([it.foo, it.bar, it.baz].join(’, ‘));
}
}

All wasn’t perfect though.

I really wanted to reuse a utility class that gets a DB connection by doing the Right Thing (gets a datasource if possible, plays nice with the pool, etc).

So I tried to do:

import groovy.sql.Sql
import mypackage.DBUtil

sql = Sql.newInstance(DBUtil.getConnection())

Unfortunately I got:

groovy.lang.MissingMethodException: No such method: newInstance for class: groovy.sql.Sql with arguments: [org.postgresql.jdbc2.Jdbc2Connection@2a15cd]

UPDATE: James kindly pointed out that I am a moron, and that I just need to use new Sql(Connection). So I changed my code:

//sql = Sql.newInstance(”jdbc:postgresql://dbhost/dbname”, “user”, “pass”, “org.postgresql.Driver”)
sql = new Sql(DBUtil.getConnection())

and it all worked like a charm!

The fact that (in practice) I can easily tie my “scripts” into my Java code is great.

Sometimes you have to write a script that takes in some data, and plugs it into your domain. Often you do that with brute force and shove it into the DB, however it is really nice that now you can:

  1. Munge data in groovy
  2. Package data in a nice way in preparation for …
  3. Accessing your service facade, passing in the nicely packaged data

Great stuff. I do have a couple of frustrations though:

  • Bad error reporting: When things go wrong (compile time) I often get a mega-stacktrace from hell. Really I just want a nice message “couldn’t compile script due to X”. Instead you end up with something like:

    … many lines …
    at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:350)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodInvokerHelper.
    ava:101)
    at dumpmetadata.run(dumpmetadata.groovy:13)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invokeNativeMethodAccessorImpl.
    ava:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invokeDelegatingMethodAcces
    orImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetMethod.java:56)
    at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
    at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    … many lines …

  • Some things just don’t work like I want them to. For example I really wish the following would work:

    println [1, 2].join(’ ‘)

    What do you think you get back? A “sorry old chap, put some parens around will you?”. Nope. java.lang.NullPointerException at groovy.lang.MetaMethod.(MetaMethod.java:84) … add many lines …

    I know I just need to make this println([1, 2].join(’ ‘)), but if you want to make parens optional, do it right :)

Don’t get me wrong…. I know these are growing pains. Hopefully we can take a leaf out of Howards book, and have line-precise errors ;)