Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Groovy-Based Agile Grails Learning

DZone's Guide to

Groovy-Based Agile Grails Learning

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

Here's my favorite bit about learning Grails, which I am doing in NetBeans IDE, via Jason Rudolph's brilliant "Getting Started with Grails" (I grabbed the free download here): I'm at the point on page 28 where we're creating "Meaningful Record Identifiers". In the Registration domain object, I'm told to add the line below:

class Registration {
//...
String toString(){"${this.name}:${this.emailAddress}"}
}

So then I run my application and I see this, displaying data from a MySQL database (hooking it up to my application was so scarily simple, I may never want to do that in Java again):

 

However, and this is the point I'm trying to make here, I didn't like the separators between the name and the address. Instead of colons, I'd like to use braces. So in the IDE, I changed the semicolon to braces, as you can see here in line 22:

 

Then... I saved the file. And after that, did I redeploy my application? No! I simply refreshed the browser and saw the result immediately:

 

Can you imagine what that means for learning Grails? Really speeds things up immensely. When you're working with constraints and scaffolding, for example, you simply add a new constraint, save the file, quickly refresh the browser and then... you immediately have a new widget in your application. One can therefore genuinely learn Grails while doing other things. I.e., you can learn it on the fly, in between other work you might be doing, because everything is so fast and immediate. That's probably old news to the Groovy community, but definitely new news to those outside of it. At the very least, that's new news to me.

 

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}