Java Platform: (http://java.sun.com/)
I have used Java for over 10 years now and i know it inside out. Admittedly the actual language is getting a bit old in the tooth now but the power of Java is so much more than the language. The reason i use Java is because i am buying into an entire eco-system of tools and frameworks that have evolved over the last 10 years plus and enormous web community of people who have used them. There is a Java library for anything you want to do on the web. So what does this mean for me... Well to put it in one word "Time". To put it in two words "Time Saving". As in saving me time by me not needing to write plumbing code when i start creating a new app. I know if i embark on a new Web project that some nice person somewhere has created a java library that does something i need. Some of my most top used java Libraries (frameworks) are:
- Hibernate (awesome Object relational mapping ORM framework)
- Spring (Glue code, provides a framework for easily wiring diverse components together in a consistent manner. But that is just scrapping the surface. This framework provides so much more)
- Sitemesh (allows me to decorate my web page easily)
- Quartz (scheduling framework)
- IText (Pdf manipulation framework)
- Apache Commons (enormous set of utility classes to help your everyday coding needs)
- and many many more...
Groovy and Grails
Well where do i start with Groovy and Grails... Well first there is a difference... Groovy is a new language (about 4 years old) and Grails is a full stack web based framework. Now when i say Java saves me time i can multiply that by magnitudes when i use Grails and Groovy.
First Groovy: (http://groovy.codehaus.org/)
Essentially Groovy is Java and Java is Groovy. Well what i mean to say is the compiled version are binary compatible but the as far as the source is concerned in many ways they are in different leagues. Essentially Groovy injects magic into Java turning it from essentially static to dynamic. Without going into details it lets you do what you did already but faster, so much faster. Here are some Java Vs Groovy highlights:
Java:
List list = new ArrayList();
list.add("one");
list.add("two");
System.out.println(list)
list.add("three");
Groovy:
def list = ["one","two"]
println list
list << "three" println list
Java:
Map map = new HashMap();
map.put("name","peter")
map.put("age","30")
System.out.println(map)
Groovy:
println ["name":"peter","age":"30"]
Java:
String name = "peter";
String message = "Hello " + name + " how are you"; System.out.println(message)
Groovy:
def name = "Peter"
def message = "Hello $name how are you"
println message
Now Grails:(http://grails.org/)
Grails to be fair took a lot of inspiration from Ruby on Rails... However it has since evolved into a framework so much more powerful than anything else available in its domain. So this is Grails in a nutshell as i see it:
1) First: Take all the best tried and tested Java frameworks for full stack web development available today (Spring, Spring mvc, Spring webflow, Hibernate, sitemesh, quartz, commons)
2) Wire them all together in the most elegant way. Throwing in some magic custom code.
3) Sprinkle Groovy all the way through the framework and make it the language to use to control and manipulate the framework.
3) Throw in a built application server Jetty and an in memory database (Hypersonic)
4) Finally Apply strict agile principals to the framework just as DRY (Don't Repeat Yourself) , COC (Convention over configuration), domain driven development, test infected.
What you end up with is nothing short of a "Revolutionary" new Full Stack web framework. The Holy Grail.
The way i see it all these technologies existed independently on there own. However the Grails guys bring them together in such a unique way the something Magical happens. Grails really is more than the sum of all its parts. A bit like Xtream Programming is.
Here are some of the high lights for me:
Convention over configuration
This saves me untold amount of time. Grails has a place for everything well everything you need. Domain objects, controller, views, services
GORM:
This is grails ORM. It used hibernate underneath but provides a dynamic groovy interface over the top of it.
Save an object:
book.save()
query and object
Book.findAllByAuthor(author)
Those methods don't exist at compile time they are added at runtime.
GSP:
Similar to jsp but exponentially more powerful.
Much much more...
I will leave it there for now: next in part 2 i will talk about
Firefox and firebug and friends