There’s a few little pain points I just encountered setting up Acegi on Grails. I appreciate the ‘grails generate-manager’ functionality, and the ‘grails generate-registration’ stuff as well, and the basic tutorial is a good start. Unfortunately, they still left off the part about having to define a role (using the role controller, for example) before the self-registration works. Specifically, you’ll need to define a ‘ROLE_USER’ in the Role controller to match the defaultRole in the security{} block in the SecurityConfig.groovy file.
I just added
def r1 = new Role(authority:”ROLE_USER”, description:”User”).save()
def r2 = new Role(authority:”ROLE_ADMIN”, description:”Admin”).save()
in my BootStrap.groovy file and this gets me going.
On a related note about Grails plugins, I’m already concerned about directive name clashes. When a plugin is registered, it can expose extra functionality to the grails command line user. In the above example, the Acegi plugin also gives you “grails generate-manager”, “grails generate-registration”, among others. Those names are pretty generic - no other Grails plugin can really depend on being able to use the term ‘generate-manager’ because it’ll conflict with the Acegi plugin should it also be installed.
I’d think it would make more sense to have a convention whereby all plugins’ functionality was prefixed by the plugin name, so the above would be “grails acegi-generate-manager”, for example.
So having recently launched a magazine on the Groovy language, I decided to check out the TIOBE index and see where Groovy sits. Not terribly high (#41) but not too bad for a relatively new language. Certainly higher than many others with much longer pedigrees. The TIOBE index also has a couple other interesting notes:
The trend for the last year for dynamic languages (vs statically typed languages) has gone down slightly.
Perl is at an all-time low
Not much to do with me really, I was just somewhat relieved to see Perl start slowing down. Yes, it’s going to be around for a long time, and yes, it’s powerful and CPAN has functionality to do everything except take out my garbage. It’s just a difficult language for me to be productive in. Always has been, likely always will be. So, to the extent that alternatives make headway against Perl, I’m happy. :)
How does all this affect Groovy? Groovy is a unique beast, being able to be statically or dynamically typed, and compiling down to Java. Many fans are eager to say Groovy *is* Java, but can be more if you want it to be. Groovy brings the power of Java to the ’scripting world’, and brings the power of scripting to the Java world, yet even that nifty phrase feels like it’s shortchanging Groovy some.
G2One, a consultancy based around Groovy and Grails (founded by the project leads of both Groovy and Grails) was recently acquired by SpringSource. SpringSource is a consultancy and product development company built around the Spring framework. I have to admit, not coming from a Java background, I still don’t 100% grasp how Spring fits in to the Java ecosystem, but I’m learning fast. The shorthand version I’m getting from people is that the Spring framework simplifies Java development. Anything that simplifies Java development is good in my book, but it apparently didn’t go far enough, because Grails seems to simplify Spring development, by bringing a standardized approach to web development and building on top of the Spring framework where appropriate.
I suspect that the acquisition will see a tighter integration of more Spring framework functionality in to the Grails framework. It’s too early for me to say whether that would necessarily be a good thing. Frankly, as a primarily non-Java person looking at the web development world in Java, the no-nonsense Grails approach has been much more productive for me than anything else (and I’d looked and tried out multiple web approaches in Java before discovering Grails).
SpringSource has an application server which looks to be a bundle of a modified Tomcat system and the Spring framework. I installed it, and there seems to be less server management functionality than even a base Tomcat gives you. From a ‘bloat’ standpoint, perhaps that’s good, but it seems to me that there’s still work to do to address the needs of the small web hosting business.
Why address those needs? Because that’s where many businesses start off. Many of the ‘enterprises’ of tomorrow will start with modest shared hosting accounts today. Right now, it’ a PITA to have a Java web app (and specifically a Grails app, but others as well) live at the root of a domain. It’s very easy to have “http://domain.com/myWebApp/” but harder to have “http://domain.com/” point to a standard WAR file. Tomcat lets you do this once per server instance by specifically naming your WAR file “ROOT.war”. Totally ridiculous, imo, and we need a Java hosting system that can manage mappings between virtual hosts and application installations (if only WAR files).
“But Java is for enterprise applications” many Java die-hards will be thinking. That’s only because it’s ceded the low-end hosting space to PHP and others by default, not because of any long-term strategy. I’ll reiterate - this is important to Java’s long term future in the web world (and what part of the software space isn’t web-related?). Smaller companies (which often grow in to larger companies later) will make their decisions based on a number of factors, but hosting support is one. Developer availability is another, and developer familiarity with hosting options plays a part in what those developers end up devoting time to learning.
Virtualized servers solve the problem to some extent, but it’s the virtual host mapping which makes LAMP-style servers attractive to many people. Multiple domains, all with root-path goodness, on one server with multiple discrete directories hosting various code. I realize I’m harping on this over and over, but it’s been shocking to me how poor the support for this sort of thing is. No decent interfaces, no way to delegate this sort of management to anyone except a server admin who has to futz around with multiple XML files on a server. This went out of fashion in the LAMP world about 10 years ago, and I believe played no small part in the fast adoption rate of LAMP applications as the dominant face of public web applications.
Have I missed something? Is it so simple to do this that no one even bothers to write about it because everyone ‘knows’ how to do it? Or is this another area of Java which people have quietly abandoned (like cross-platform desktop multimedia). To the extent that Sun is renewing their efforts behind JavaFX, we may see some traction for desktop Java again. I’d like to see them (or anyone) make the same commitment to low-end Java hosting.
SpringSource, with its Grails acquisition, may be in a good position to address the needs of this market, helping to nurture a next generation of Java developers getting their first start with Java on Groovy and Grails web applications. I’ve no idea if this is in their plans, but it doesn’t seem out of the realm of possibility. Or does it? Am I barking up the wrong tree? Or just barking? ;)
I wrote up a small synopsis over at the GroovyMag blog about the acquisition, then just got pinged that my own quote about it made it in to PC World. I’m famous. ;)
My initial reaction was that this might hurt Groovy and Grails development, but I don’t think that’ll happen. At least unless Spring ends up going back on whatever commitments they may have made privately to Graeme and Guillaume from G2One. G2One would have no reason to agree to be acquired unless they thought it would ultimately be a good thing for the communities they serve. Additionally, this doesn’t strike me as one of those ‘cash out and retire’ sort of deals. SpringSource is buying Graeme and Guillaume’s names, reputations and experience, if nothing else, and likely wouldn’t *let* them just walk away. What would have been the point of an acquisition if your primary assets leave the next day? :)
Ultimately, we’ll wait and see how this plays out, but I’m cautiously optimistic that this will help mainstream adoption of Groovy and Grails technology.
This was the analogy I came up with when teaching a PHP class recently. I needed to review the topic of regular expressions, but it’s one that neither I nor the students seemed to have much interest in. The examples that I had were adequate, but explaining the examples was still unnatural. The students didn’t want to spend much time on regex, but I pressed ahead. I suggested that regular expressions were like the broccoli of programming - something that left a bad taste in your mouth, but was ‘good for you’. Now, usually the broccoli I eat is drenched in ranch dressing or balsamic vinegar, so it doesn’t leave a bad taste in my mouth. And I know I’m not joined by 100% of the population out there - there are people who *enjoy* eating broccoli (and enjoy the taste as well). They are a minority, just like people who enjoy writing and using regular expressions are a minority in the programming community.
Given my premise that regular expressions are like broccoli, what comparisons would you draw to other programming concepts or functions?
Closures are like carbohydrates? Or chocolate?
Classes are like ________?
Functions are like _______ ?
Unit testing is like _______?
What catchy similes can you help me come up with? Are these similes? Or metaphors? I used to say that an analogy was to a metaphor as a simile was to a __________ (this was one of those comparison fill-in-the-blanks you get on standardized tests). Can you fill in that blank for me? :)
To celebrate our US elections, GroovyMag is on sale for $3.49 today only (November 5, 2008). President-elect Obama won 349 electoral votes, and in an effort to ’spread the wealth’, GroovyMag has lowered the price to reflect the electoral vote count. Visit http://www.groovymag.com/main.issues to purchase your copy today!
I was meaning to write this a couple weeks ago, but I’ll do it now. I think this presidential race may end up being far closer than anyone suspected. So many polls have Obama up, but I think this will end up being much tighter than people were thinking even a few days ago. Not sure why I think that, I just do. I do not think that we’ll see any 2000 Florida situation, but if it happens it won’t surprise me.
I received this email from Elizabeth Dole’s committee:
By now you have probably seen the new TV ad about Kay Hagan and the Godless Americans PAC.
[video player image inserted]
Kay Hagan flew to Boston, Massachusetts earlier this year for a fundraiser in support of her Senate campaign. This fundraiser was hosted at the house of the founder of the Godless Americans PAC.
This is a group that wants to take “under God” out of the pledge of allegiance, “In God We Trust” off of money, and eliminate Christmas as a federal holiday.
Today, Kay Hagan held a press conference stating that she had never heard of the Godless Americans PAC until the TV ad.
Really!? The problem with Kay’s false answer is that the Dole Campaign issued a press release on August 26, 2008, three weeks before the fundraiser, laying out exactly who was hosting the event. It was also printed in the Raleigh News and Observer, and Hagan’s own campaign representative was quoted in the article.
Hagan then claimed she did not take money from them. Again, not true. The founder of Godless Americans PAC and Hagan’s host for the evening contributed the maximum allowed by law to her campaign.
Why is Kay not telling the truth?
Why is she hiding from the fact that she accepted thousands of dollars from the founder of the Godless Americans PAC?
North Carolina deserves answers and the truth.
There is too much at stake in this crucial election for Kay Hagan not to come clean and be up front about her associations.
If you believe in honest, hard working leadership, DONATE TODAY and send Elizabeth Dole back to the United States Senate!
To start with, I’m not sure where Elizabeth Dole’s campaign got my email address from. I don’t remember signing up for info from them, and the format is “MICHAEL@kimsal.com”. I certainly never type my email in that way in any signup form.
Re: the email’s message. While I fear that this may ultimately work for Dole, is this really the best that they can come up with? Hagan supports abortion and took money from atheists (these are all I hear on the commercials). What about positions on issues of substance (change that to *other* issues of substance if you think these issues are substantive already - I think they’re not).
Where does Dole stand vs Hagan on issues of employment, tax policy, immirgation, healthcare, transportation, energy, macroeconomic concerns, and other topics that affect our lives more directly than what words appear on our printed currency?
I suspect Hagan needs to distance herself from this “godless american” thing because of where we live - North Carolina still seems to be populated mostly by people with religious beliefs, and ‘atheism’ is some knee-jerk thing that will scare people away without even thinking.
It seems its still relatively easy to bash atheists in public, and perhaps even be lauded for it by constituents. Replace the concept of ‘atheist’ up there with ‘Jew’ or ‘Muslim’ or ‘Catholic’. Would Dole be able to get away with something like that?
For the record, in April I ended up sitting next to one of Kay Hagan’s daughters on a plane trip from Raleigh. She was exhausted from having done door to door campaigning for her mom a couple days before, but was still pleasant, chatty and kind to a number of passengers (our flight was delayed after we boarded, so we had some time to chat). She engaged many of us, encouraged us to vote, and was simply one of the nicer people I’d met for a long time. She was not the primary reason I voted for Hagan, but she was certainly an early introduction to the Hagan campaign which made me do some more research.
I was somewhat on the fence until the Dole attack ads started coming out, which cinched it for me. Dole, your attack ads are working, just not in the way you’d expected (at least on me).
Yes, Dole, NC deserves the truth. So quit bashing Hagan and tell us the truth about where you stand on various issues. Spend your money talking about your own positive aspects and views on issues, instead of bashing your opponent over potential religious beliefs.
I’m getting ready to launch GroovyMag - the magazine for Groovy and Grails developers - next week. This will initially be a PDF-only product, tentatively priced at $4.99 - but we may move to print quickly if the demand is there. The first issue is a bit over 30 pages (we’re playing with layout right now, so it’s not final yet), and I’ve been fortunate to have a stellar set of contributors for the first issue. Dave Klein, Andres Almiray, Shawn Hartsock and Robert Fischer are all known and respected in the community, and I’ve been honored to have them help launch this magazine with their articles.
Check out http://www.groovymag.com to sign up to be notified once the magazine goes on sale!