Saturday, December 02, 2006

A groovy week on grails

So the Ruby on Rails people asked the group that started the "Groovy on Rails" effort to stop using the term "on Rails" (whatever). That is why they have the name Grails now. They didn't ask me and I have to say that this week of building a first end to end app for production use with Grails was quite groovy.

First, I do like the coding by convention approach that allows less code and less configuration to be used. I also like that what configuration is there is in the form of classes not XML. We made an app for the ANDRILL effort and it should see the light of day soon (ie be reviewed and deployed).

During the course of this development I was very impressed with how the various packages in Grails: Hibernate, Quartz, AJAX (via prototype in my case), Spring (obviously) and the GORM objection relation mapping all work. I am very keen to make up a Quartz job and then use the jabber resource to make a job that looks for changes or additions to the database and then IM's me. That is more for me, the real version would likely report via email.

We did run into some issues (Grails is only version .3 after all). An issue with binary uploads in a none scaffolded controller (I assume the generated static code is somehow out of sync with the dynamic scaffold generated code). Also had an issue with using the remotelink tag for AJAX calls vs using the remoteform tag for the same effect. We resolved this by just not using them :) but I need to report this to the Grails people to see if it is a known issue or something I was doing wrong. Getting used to the scope of certain classes and methods took some getting used to as well, but that is more just my ignorance with how the plumbing was working at the start of this effot.

Having full access to the all the wonderful Java classes makes Grails a no brain-er for me over Ruby on Rails. I have to admit I am a bit sad that Sun seems to be in love with Ruby (via jRuby which ironically is also a codehaus effort at http://jruby.codehaus.org) and pays little if any attention to Grails so far (hopefully this will change). Yes, though jRuby the Ruby syntax gets access to the classes as well. We will see how this all works out. I was interested to find that one of the key people in the Apache Geronimo effort is also one of the key Groovy people as well. Ruby has some very cool aspects to it, but I think the JVM is a better host for it than as a stand alone app directly on top of the OS.

In a final experiment (ref: InfoQ Grails + EJB and a Graeme Rocher blog entry) we used entity classes (not entity beans) that we generated via Netbeans for a database and dropped the POJO's into a grails app and were able to get read and write access to the db via the grails app using these entity classes as our domains with simple generated controllers and views. We had some issues with primary key mappings, but nothing too hard for us to work around. This was interesting to me since I could use the entity classes along with Hibernate to do the data access work and then Grails as an lightweight flexible dev layer on top of that. Grails lacks sophisticated buses like Service mix and others, but I am not certain I need or want those at this time (or that I can't do what I really want inside the Grails framework anyway).

Sunday, November 26, 2006

coding by convention vs prior convention

Been a while since I posted. I have still be doing some work with Grails and Java EE5. I completed out my test for UI's via AJAX as well but I thought I would put down some thoughts on coding by convention.

I am new to the Rails approach and I have to say I quite like it. The idea that the file system, file names and such carry meaning and that the framework uses these to look for things that might otherwise be designated in XML configuration files is quite nice.

Until of course you create a domain image. I created the domain image in Grails. This has the effect of telling Grails that any URL with /app/image in it should be processed by the controllers, services and such associated with that domain. Unfortunately this also means that img tags with src attributes that use /app/image in their path don't load images from a directory in that path, but that pass the request on to the domain controller.

It's a small point perhaps, but it does make me wonder what else I might run into. Domains with names like image, pdf or I am sure many other (conventional names) just might interfere with the convention of the framework.

Monday, November 06, 2006

Working on contrasting EE5 and Grails (Rails)

It has been a while since I did a post. I have been busy at work on some new architecture designs and intend to make a good entry contrasting Grails and Java EE5 efforts soon. However it has been a while and thought I would post up some errata thoughts I have had. It has been very interesting to see how the two efforts (Grails and EE5) deal with similar goals compared and contrasted to each other. Trying to do the same thing in two different frameworks has definitely made it easier to see how each is addressing needs. Of particular interest is comparing how grails deals with call backs from ajax widgets to server side logic compared to the Java Jmaki effort. I've got a longer post with my lessons from this that I am working on for a later date.

I must say I have come to really like closures. A programming concept I have not used much to this point. Groovy (which Grails is based on) does closures and I also found an interesting page on closures for Javascript. Ruby also obviously does this well.

I selected Grails over Ruby on Rails mostly due to the access I would have to the JVM combined with the Rails approach. Also since I was wanting to contrast against a pure EE5 approach this made more sense. By pure EE5 I mean an entity bean approach combined with JSF. With the hiring of Nutter and Enebo by Sun Microsystems, Jruby (another codehaus.org effort) could becoming an interesting option too since then "Ruby" will have access to the Java API's. It has that access now I believe, however I don't believe the Ruby and Rails aspect of Ruby is fully over to the JVM yet. I do like the coding by convention vs. the XML configuration approach however. I love XML, but think we have done too much with it in places where we could just use the coding language we have available. I definately will be looking at Ruby in general and the Ruby on Rails community more.

A very interesting interview is given by Tim Bray on InfoQ. It's a great listen for anyone interested in dynamic languages, RAILs concepts, ReST vs WS and some of the issues surrounding them.

Tuesday, October 24, 2006

AJAX and server side scripting

I ran across this page at the sun developer site. It has a very nice run down of various AJAX design strategies. (Ref: http://java.sun.com/developer/technicalArticles/J2EE/AJAX/DesignStrategies/?feed=JSC). This is a good read not just for Java developers but anyone. The principles in it apply toward the development of any architecture in any language implementing AJAX.

In reviewing this document I came across a project again that interested me and spent some time playing with it on our app server (glassfish this time). This is the Phobos project (Ref: https://phobos.dev.java.net/). It basically allows for the use of javascript (and later other scripting languages like hopefully Groovy) to be used on the server side. JSP and JSF use tags to embed Java code into pages that are rendered server side. Phobos extends this to javascript with the concept of "ejs" files which embed javascript into the page for server side rendering. The benefits to an AJAX implementation of javascript on both side are obvious. I do not know yet how well the server side javascript has access to the Java classes. Future integration with JMaki might also make future use of JMaki widgets in Phobos apps easy. How might one instance this into a remote domain though?

I am still curious if one could simply make a GET call to an app server that would render custom javascript in JSONP manner and return it to a script call of a page. In truth couldn't this be a servlet. A servlet responds to a GET call and can return just about anything. So one would seem to be able to make a servlet that returns JSONP. If the Phobos server could return JSON or JSONP as well as EJS rendered HTML that might open some interesting possibilities for remote access to widgets. This may be worth some investigation and comparison to some of our early GWT application experiments.

Sunday, October 15, 2006

Why Portals Must Die

A few days back I read a couple articles on some efforts by Google. These were an article on Googles Gadet effort and Google /BEA mash up talks.

While interesting in their own right and likely the kind of thing being done by Yahoo, Microsoft and others it got me to thinking about a mantra I have had going for some time:

Portals must DIE.

This is not to say portals themselves in concept are bad things. Only that they are often used or implemented poorly. I oversee a JSR-168 based portal myself and direct development of applications under that. The intent of portals is obvious. It provides a development group a unified display and authentication API set, among others, to work with. This helps to focus development skill and look and feel issues. A great thing compared to developing against a myriad of API's. Of course portal API's themselves don't talk to each other so little was gained for efforts outside the local enterprise (or enterprise group). In the Java camp the JSR-168 helps to focus efforts around a common portlet spec and that is great. Web services for remote portlets (WSRP) might have been a wonderful thing had I ever seen one example of it in the wild.

It is just that portals don't allow for dynamic mixing of content from various sites into my own space. I can't easily (yet) pull maps from Google, stock tickers from Yahoo, search interfaces from 3rd party databases sites and simply drop them into my page and have them work with authentication and styles (CSS) resident there. I want to be able to do this, so portals must die.

I believe that the common HTML DOM or a CDF derived instance is the common glue (as I spoke about in my OpenDoc posting). Combine this with remote AJAX applications that have some capacity for awareness of secure federated identity and we begin to see the a portlet concept in this environment. Secure "inter-AJAX portlet" communication could be done via a messaging middle-ware though I want to explore what Javascript allows in terms of intercommunication between various functions in a web page to see if that is possible. Look and feel issues could be addressed through systematic CSS utilization. In a manner similar to GWT.

To me the future portal is a simple DOM with portable code that can be pulled across the net to create its UI through local DOM object manipulation. Combine this with federated identity and CSS based styling for logging in and look and feel issues respectively. Let the whole thing talk to a services oriented architecture for logic execution. Hopefully the efforts of the W3C Rich Web Clients efforts will go well.

.NET 3.0 an attack on standards?

So I read my first article on .Net 3.0 this morning over at informit.com. I then headed out to the Netfx3 site and did a little reading on the Communication, Presentation, Workflow and Cardspace foundation that are part of .Net 3.0.

Microsoft has obviously turned their back on standards like Web services, SVG, efforts like SAML, WS-Federation and the Liberty Alliance. I am sure they have done in this in the name of "user experience". However, this will be user experience only on Microsoft Windows.

Do I trust that things like WPF/E (the "Everywhere" cross platform version of WPF) will be coded to, made easy to code to, be used at all by many developers? Of course not, Microsoft has no interest in doing that. As a company they have fostered a culture based around ignoring standards and ignoring where the network is going. Even as powerful as they are, I have no doubt they will fail, but they have the potential to cause huge amounts of damage to peoples data along the way.

The core interconnecting standards of the net are under attack. Microsoft will use its influence, FUD and any other tactics to encourage this. Then they will wrap themselves in the flag of "competition is the cornerstone of capitalism" implying that they are the moral high ground holders.

It is obvious that Vista and .NET 3.0 will bring the most concerted effort yet by Microsoft to undermine Internet standards and cross platform environments.

Friday, October 06, 2006

CDF + Google gadgets = OpenDoc ?

So recently Google was noted for putting out "gadgets" that could be syndicated across the network (ref: Cnet ). The direct link to this being at: http://www.google.com/ig/directory?synd=open/.

This is basically javascript that you can instance in your own web page. There is nothing spectacular about this. However, Google has done a nice job of making it easy (easier) to do this. I am a big supporter of this syndication concept even though there are likely several issues still with this idea especially around security. (One Ref at Greg Murrays Blog)

Now combine this with something like the W3C CDF efforts. CDF allows a developer to place multiple XML formats into a common document.

The collision of all this reminds me of something from Apple from way back. Those that know me know I still haven't gotten over OpenDoc. systems could begin to However, CDF + remote web apps like AJAX Esqdevelop the kind of application that currently is still restricted to the true rich client applications. I don't know where web based applications will stop in terms of being reasonable approaches. Email, RSS aggregation, content management and many other types of communication based efforts have done very well on the browser platform. Lately word processing, spreadsheets and other attempts have started to crop up. I doubt we will see an AJAX based GIMP (or ever want one). For the most part, if I am working on data or creating data local like in a GIMP image there is no need to send that over a network. However, Writely has shown that even word processing can benefit from network aware ability, in its case in the form of real time collaborative editing of documents. (Apple Knowledge Navigator)

Imagine though a document with a SVG canvas being written to by an embedded ajax application communicating over XmlHttpProxy and then locally updating the SVG canvas through inter DOM communication. How about an OpenGL canvas? (Java 3d and applets is perhaps a bit of a digression for this posting, but not much).

I am encouraged and interested by where an open format, open standards based approach will go that mixes interactive applications with the DOM and graphics languages like SVG and perhaps even OpenGL.