Dave Klein

author
+ Follow
since Aug 29, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dave Klein

Perhaps Grails is the gateway to understanding the concepts before delving into the depths of Spring.


My introduction to Spring was Grails and I think it was a wonderful gateway and on-ramp. You can start out using Spring without knowing that you're using it and then as you have the need / desire you can dig in deeper and deeper. As you do dig in, Grails still provides ways to make it easier like the Spring Bean Builder DSL and support for the newer Spring annotations.

Though, I must admit that I'm a bit biased, I highly recommend Grails as a way to learn Spring. I also recommend keeping a copy of Spring in Action with you as you work with Grails. It will help you to see what Grails is doing under the hood.

Dave
14 years ago
Hi Amit,

I'm not Craig and I know this isn't what you were asking, but one of the easiest ways to use Spring MVC is with Grails. The power of Spring MVC (and other Spring goodness) without all the complexity.

Take a look at : http://grails.org/Developer+-+Spring+MVC+Integration
14 years ago
Who's waiting to win one? I ordered one and it's winging its way to my house even as we speak!

Thanks,
Dave
14 years ago
JSF
Do you know of a tutorial for building a simple JSF app without an IDE?

Thanks,
Dave
14 years ago
JSF
You're welcome. All the Pragmatic Programmer's ebooks are only available from http://pragprog.com. One thing to note is that if you buy one of their paper books from Amazon.com or from a bookstore, etc. you can register it at and still get the combo discount on the electronic version. I recently did that with several books in my library.

Dave
14 years ago
Grails: A Quick-Start Guide is currently available in kindle and epub formats (along with PDF) at pragprog.com. One price gets you any or all formats as well as updates.

If you are going to continue working with Grails, I would recommend getting Grails in Action and/or Definitive Guide to Grails. For more in-depth Groovy info, I highly recommend Programming Groovy by Venkat Subramaniam, which you can also get in kindle format at pragprog.com.

I hope you enjoy the adventure and if you get stuck you can post questions here.

Dave
15 years ago
I think Gregg answered the performance question quite nicely, but I'll take a crack at the other two.

You can consume web services, RESTful, SOAP, or other, in a Grails application. I would normally put this type of code in a Service class that can then be injected into any of our controllers or domain objects, etc. Grails can also act as a WS server either by coding it from scratch (which is easy with REST) or by using one of several available plugins (XFire, Axis, CXF, DWR).

You can use Grails for front-end only, though, more acurately, it would be front / middle. In other words you could use Grails views and controllers and have the controllers access services which can call your external web services. You could leave Grails services out of the picture if you wanted to, but I find them very helpful for that sort of thing.

Hope that helps,
Dave
15 years ago
If you append ?showSource to your initial request you will get a page showing the compiled page.

If you post the contents of the template, perhaps someone here could help figure out what's causing that error.

Thanks,
Dave
15 years ago
Great questions. Here's my attempt at some answers:

1. Unlike most other Java web frameworks, Grails addresses the full application. If you write an app in Struts2, Stripes, JSF, etc. you still need something else to handle the "back end"; Spring/Hibernate, EJB, etc. Grails uses Spring and Hibernate but builds it in so that all the layers of the application are handled cohesively. Another, and probably more important, difference is convention over configuration. (Note "over" not "instead of") Many basic decisions are made by following simple and sensible conventions. No XML configuration files required. You can configure to hearts content if you want/need to, but in many/most cases you don't need to. This combined with features like GORM dynamic persistence methods (get(), save(), findAllByPropertyName(propertyVal), etc.), custom tags that are so easy they should be illegal, convention based Codecs, URL mapping, and more, make Grails a very productive and enjoyable way to build web applications.

2. I haven't used Rails or Django, but from what I've heard there are several similarities in philosophy (Convention over configuration, dynamic language, persistence).

3. There is another thread on this forum that addresses this question pretty thoroughly: https://coderanch.com/t/470335/Groovy/Grails-weak-points

4. If you have some experience with Java, Groovy will be easy to pick up. If you also have experience with Ruby and Python, then it'll be even easier. Many of the things you like from Ruby or Python and wished were in Java, are likely in Groovy. Groovy basically brings things like closures, metaprogramming and dynamic typing to Java.

In short, if you are planning on doing web development on the JVM, you owe it to yourself to at least take a look at Grails.

Have fun,
Dave

15 years ago
Parsing HTML, unless it's extremely simple HMTL, is tricky business. You're probably best off using a Java library, like HtmlEditorKit, for that. If you do a Google search for "HtmlEditorKit extract text from html", you'll come up with some examples.

As for identifying URLs in a file you can use regex for that, though it can get ugly too. Here's a JavaRanch thread with an example: https://coderanch.com/t/382015/Java-General/java/regex-find-url

Have fun,
Dave
15 years ago
sum() is a method on Collection after it's been enhanced by the GDK. It was there in 1.0 but new over-ridden versions were included in 1.5 and above. You can read more about it and find many other hiddend Groovy nuggets in the GDK docs: http://groovy.codehaus.org/groovy-jdk. This doc will show you all the nifty features added to JDK classes / interfaces.

Have fun!
Dave
15 years ago
I have to agree with Andrew on the IBM series by Scott Davis. I used them to train the Java developers on a team I was leading before writing GQuick. And if you've heard Scott speak before, when you read his articles it'll seem like he's in the room with you.

Dave
15 years ago
It looks like you had a couple minor errors in the regex:

GinA page 165 code has this:
and your example has this:
Notice the sequence: ".[a-zA" from GinA. Your example has ".=a-za"

I hope that helps,
Dave
15 years ago
There are none that I know of and I have asked around and nobody I've asked has heard of any. If any were to appear in the future they would probably come from SpringSource. So, you may want to keep an eye on their site or send them an email and let them know you're interested in certification.

Dave
15 years ago
Thanks all, for the good questions and kind words! Congratulations to the winners. I hope you enjoy the book and I'd love to hear your thoughts.

Thanks also, to the folks at JavaRanch for putting this all together. You guys are doing a great job!

Dave
15 years ago