Monday, February 11, 2008

2008 - Programming Technologies to look for:
Comet Programming:
a web server sends data to a web browser (client) asynchronously without any need for the client to explicitly request it, So it's a server side AJAX (supported in Tomcat6). This is great feature & opens up lot of possibilities with server side events. It's like RMI's Callbackinterface where client can listen to events from UnicastRemoteObject.It has great potential where it's not advisable for client to poll . Servlet2.5/Tomcat6 will support Comet programming & I am sure all the frameworks will start laveraging the same. But I am little skeptical about the popularity of this; although the statements from several authors are exciting.

Web Technology Frameworks:
I tried out some samples with component frameworks. Since I have been working swing programming model, it was so easy to write Listener anonymous classes. I wrote samples with GWT, wings & Echo.I did more work with wingS as they were using YUI library as backbone.
I also followed Wicket & Tapestry very closely. I am yet to work with real project to really appreciate the necessity of having to define HTML & Java artifacts for each page. zk framework,JSF & many other frameworks compete for this space. Wicket is my favorite component oriented framework although I am not sure it's scalability capabilities. As tapestry claims to work well with highly scalable sites, there is neither such explicit asserstions or sample sites avaiable for Wicket to prove that it's possible to create highly scalable sites, anyway I am excited to work with new Wicket release that will get released in coming months leveraging JDK1.5 features. Although personally I love swing programming model,my guess is page-centric MVC is going to be mainstream web programming model in 2008 as well. RoR, Grails are offering great productivity gains in this space. Grails1.0 got released in Feb 1'st week & I believe that 2008 will be Grails year as for as page centric web sites development is concerned & it's going to be Wicket year for developing complex web applications.

Closures & DSLs with dynamic languages:
Last year there was lot of discussion on aspect oriented programming & dependency injection. Dynamic lanaguages have brought lot changes to the programming parctices with Groovy & Ruby leading the way.It was difficult to commit to any of these two languages (Groovy & Ruby (JRuby) ) , Although Groovy looks to be easiest to select for Java programmer I was little skeptical as Sun choose to invest over Ruby/JRuby over Groovy & Thoughtworks , a technically intelligent company invested in Ruby. But after trying out few samples I am convinced that Groovy is the best way for dynamic programming for Java programmers. Closures, DSLs & weak typing languages are simply unstoppable on JVM. I bought Groovy In Action book.

Closures:-> As a swing programmer, I have been using anonymous classes a lot. Spring's JDBCTemplate... & other template wrappers were huge hits for me. Not only closures will help solving resource handling( File, Database, User Interfaces, transactions (open<>close)), they also help better thinking (recurse & iterative). Joel explained them well here. The main point I guess with closures is that we can assign a variable to a method & use just like any object & you can pass on these parameter to a other methods as explained superbly here.
I used to wonder about the reason for final variable only accessibility in anonymous classes. I found explanation here, where Guy Stele says java should not allocate any memory in heap without "new" call & allowing non-final variables violates this. He also says dynamic class loading ,reflection already violates this principle. Anyway it's clear that anonymous classes are not equal to closures. Paul Graham argued brilliantly for closures saying succinctness is power long back. Paul's concern over java for not providing power & Joel concern of java being simple, I guess are now solved with dynamic languages.With James Gosling asserting that it was resource/time constraint that prevented Closure inclusion in original JDK, closures are likely to reach java mainstream this year.

Some useful links on this topic:
Review of Groovy/Grails books from Matt Raible
Higher Order Functions with Groovy - GINA book doesn't cover this topic
Closures samples
Some closure theory
Closure proposals from Bob lee (Guice creator) & Josh Bloch where they argue removal of new keyword to support closures.
comparison of different closure proposals:
Closure Debate from IBM
Language comparison:
A closure sample in Groovy

Some how Fluent interfaces were not familiar or popular in Java world. Standard Java bean definition is not really good way to define & populate objects. Martin Fowler defined them as back as Dec 05. Although fluent interface & builder pattern cannot be implemented in java easily my guess it's happening mainly because of Java Bean spec (which are well used by frameworks(ex.hibernate) & tools (IDEs)), we can also write java code like,
new Person("test","test").email("praveenm").firstName("Praveen").lastName("Manvi"); instead of calling set method on each variable. Many JDK standard classes like StringBuffer, ProcessBuilder already using this. I guess more & more APIs will start using fluent interfaces like JAXB2 commons.I am also planning to write a plug-in in netbeans/eclipse to extract fluent interfaces from existing classes. Venkat provides a very neat explanation about the necessity & usage of DSLs & XML limitations to be used as full fledged DSL.
Cloud Computing, Grid computing, Virtualization might reach masses this year.
OSGI - OSGi is going to change the deployment and run time model for enterprise apps.(Although I am not able fully appreciate/understand the value even after going through literature, The immedeate advanatage I see as of now as a Swing programmer that I can run may java apps with single JVM which is painful now), Although Oracle, Bea (Oracle?), IBM & more importantly Spring showing lot of interest & excitement, Sun doesn't seem to be that excited
So exciting days ahead...
Bookmark and Share