Thursday, April 17, 2008

Firefox 3 beta 5 Rocks

I know I have only been playing with it for two days but I am really impressed with Firefox 3 beta 5. I especially love the auto complete feature which not only shows you recent sites that match what you have typed so far, but it also shows the favicon and the title of the page.

Saturday, April 5, 2008

Grails Integrated Framework Documentation

One of the things I really like about Grails is that it does not suffer from "Not Invented Here" syndrome. Instead or reinventing the wheel, it integrates with best of breed proven open source frameworks. It then goes on to make the integration seamless hiding much of the complexities of those frameworks. But sometimes you need to access those frameworks more explicitly and therefor you must learn there apis, configurations and other details. So, below is a compiled list of the documentation for the frameworks Grails integrates.

Groovy - User Guide - API & GDK
Spring Framework - User Guide - API
Hibernate - User Guild - API
SiteMesh - User Guide - API
Jetty - User Guide - API
HSQLDB - User Guide - API
JUnit - User Guide - API
Ant - User Guide
script.aculo.us - User Guide - API
Prototype - User Guide - API
OpenRico - Demos

Wednesday, April 2, 2008

New g-wizMOBILE CTO

I am excited to announce that in addition to my responsibilities at Judd Solutions, I have excepted the position as the g-wizMOBILE CTO. g-wizMOBILE is a service and product company targeting the mobile platforms of J2ME, iPhone, Android and WAP. Mobile is such an exciting and emerging market. I look forward applying my years of J2ME and enterprise Java experience to create exciting new products and help other companies trying to develop and deploy their own mobile applications.

Wednesday, March 19, 2008

Groovy Meta Libraries

The more and more I write Groovy, the more I really like its meta-programming (Meta-Object Protocol or MOP) capabilities. I find myself frequently refactoring code into meta methods of existing Java classes that would have otherwise been methods in some utility classes. I am slowly building a libraries of these I would like to reuse. Unfortunately one thing that challenges me is what is the best practices for turning them into reusable meta libraries. I would like to be able to package them in a jar and just drop them in the classpath and they would be automatically available(bootstrapped). This would make them easier to carry between projects and share with the community. There would also have to be a good way of creating good GroovyDoc like we have with the GDK. If somebody has a recommendation or idea I would love to hear it. Otherwise, I wonder if there could be a standard way to use the Java jar service provider mechanism like JDBC driver do now to auto register.

Thursday, March 13, 2008

I might be getting this DSL stuff

I know I am a little slow. I usually have to hear and see something three times before I start to grasp it. I know it was that way with Aspects and it has definitely been that way with DSLs. At every conference I have gone to for the last 2 years I have made sure to attend DSL talks. I have probably seen Neal Ford speak on the topic at least five times alone. By this point, I have definitely understood the concepts. Hearing Neal Ford's Starbuck's language example gave me that aha moment. But I have not been able to take it to the next step. I have not been able to put it into practice. That may be because I have been writing code so long I don't see problem with curly braces and long lists of method chaining and ugly parameters. But tonight, I think I got it. I think I saw the value in a whole new way.

I took this simple example written in Groovy that only a programmer could love.

println this.class.getResourceAsStream('readme.txt').getText()

This example only reads a file found in the classpath and then prints it to standard out. It might look pretty standard to developers but to anybody else it looks like a cryptic foreign language. This example is even in Groovy which simplifies the code a lot compared to a Java equivalent. (I actually started writing a Java equivalent for this post but it was too painful after writing the Groovy solution so I stopped.)

So after looking at this example, I set out to write the same functionality in a human readable format. In all the DSL sessions I have attended, they always say start of with the end in mind and make it look like a sentence.

So, I came up with "write readme.txt contents". In code it looks like the following example:

write 'readme.txt'.contents()

Not to bad for my first DSL. I think the intent is pretty clear. Next is how I implemented it.

String.metaClass.contents = {
this.class.getResourceAsStream(delegate).getText()
}

def write = { file ->
println file
}

write 'readme.txt'.contents()


You can see I used a little bit of Groovy's MOP (Meta-Object Programming) to add a contents method to the String class that does the resource loading base on the delegate which is the object on which the message was passed which in this case is the 'readme.txt' String. Next I defined a write closure that does a println on the parameter passed. Note using Groovy's optional parentheses makes it flow much more like a natural sentence.

Now that I have reached this milestone, I am afraid all standard code is going to repulse me. I know I am stuggling to write Java code after having used Groovy.

Other advantages to Apple distribution model for iPhone apps

Another great advantages of distributing applications for the iPhones is not having to write installers or complicated installation instructions. That alone should save lots of development time and support headaches. Wouldn't it be nice if all software installation could be this easy.

Wednesday, March 12, 2008

Apple's iPhone application deployment model is fair

In talking to some of my fellow developer friends about the recent iPhone SDK launch, they are shocked and disappointed with Apple's for distribution model but especially with Apple's 70/30 split of the sale of the applications.

I happen to think this model is quite fair. Here is a list of things included with sharing 30% with Apple:
  • distribution
  • credit card transactions
  • marketing
  • platform
I think this makes the program a great bargain. For example other forms of distribution like retail often have a 40-50% markup. More importantly Apple is providing the opportunity by providing and opening the platform and SDK at no additional charge.

I also can't believe the Standard Developer Program is only $99. I have been developing J2ME application for several years now. Whenever you deploy you typically need to sign the J2ME app it can be $500 for a single deployment option because of certificates. If want to make your application available through several carriers you might have to have several certificates which cost additional money and add to the packaging and deployment complexity.

But the final benefit is the program includes free distribution for free apps. So if you don't want to share 30% with Apple, there is a missed revenue opportunity in Apple's plan. I have not heard or seen anything relate to participating in sharing for any other monetization options. So if you give away your application for free but sell ads, you can save it all :)

Finally, if you are looking for iPhone developers please contact me, I am very excited about the platform and would love the opportunity to work on this new frontier.

AWS EC2 Hibernate Java SDK v2 Example

I recently wanted to automate the creation of developer VMs in AWS using EC2 instances. To improve the developer experience (DX), I didn...