views:

629

answers:

5

I am embarking on a new RIA project with Java on the backend. I'm the only developer, and the app is a line-of-business application. My current stack looks like this:

MySQL || Spring(JdbcTemplate for data access) || BlazeDS (remoting) || Flex(Cairngorm)

My question is: what changes can I make to improve productivity? Manually coding SQL, server-side entity objects, client-side value objects and all the Cairngorm stuff is obviously a drag, but I'm not sure what higher-level frameworks to introduce.

What Flex/Java stack has served you well?

+4  A: 

Manually coding SQL

Hibernate is an option to cut this out.

One thing that may be of interest is Grails with the available Flex Plugin. It's built on Spring, Hibernate and BlazeDS, so it's all there for you. It was unbelieveably easy to get it remoting stored objects and responding to AMF calls. I was using this and then moved over to a RESTful E4X implementation as I found it a lot easier to debug and tweak as I could inspect the server output in a browser and have tighter control over exactly what I returned to my Flex app (lazy loading problems in collections using BlazeDS were a headache at times).

Here is a quick tutorial showing how easy the whole Grails + Flex Plugin stack is: BlazeDS in Grails

Hates_
Thanks for your quick answer. I've never used Grails but have played around with RoR (and went through the Flexible Rails book). In the end, I decided against RoR because I didn't feel like learning Ruby, but how easy is Grails for a Java developer?
Mike Sickler
I don't think it's hard at all, but it's hard for me to be subjective as I did quite a bit of RoR before Grails came along. If you know Java you won't have any problems with the Groovy syntax, you can even code it as if it were Java.
Hates_
+1  A: 

As alternative to hand-coding sql, aside from hibernate, you might wanna consider JPA/Toplink. And since you are already from a Spring camp, check out Spring ActionScript (formerly known as Prana), it's an IOC framework for Flex. It solves many inherent problems in Cairngorm. Also a good IDE that supports Flex/Actionscript like IntelliJ IDEA 8.

Whats missing between Flex and BlazeDS is, it doesnt have any sort of landing page where you have a listing of all the available services by just typing a url on the browser (similar to webservice endpoint).

Stephen
We wrote a Servlet to do this with about 200 lines of code. Simply get a reference to the MessageBroker in your servlet and walk over RemotingService / RemotingDestination and write it out as an XML file usng something like dom4j.
cliff.meyers
+4  A: 

I would seriously reconsider using Cairngorm. In my opinion it's a pretty bloated framework that introduces a lot of abstraction you'll never use. Check out:

http://code.google.com/p/swizframework http://www.spicefactory.org

Both introduce the concept of dependency-injection into your Flex app.

Also +1 for Hibernate. I would use the standard JPA annotations on a Java class and extend that with Hibernate Annotations as you find you need additional functionality.

cliff.meyers
Thanks a lot- Swiz looks really cool and easy to use. You're right- even with Cairngen helping me with the boilerplate code, Cairngorm just feels like a ball and chain. Cheers.
Mike Sickler
A: 

You can try GraniteDS. It's an alternative to BlazeDS, with an actionScript generator, Spring integration (an Spring security), and if you use an JPA implementation, help you with the Lazy Initialization (in a transparent way).

aledbf
Thanks for the suggestion. Following _Hates' endorsement of Grails, though, I've adopted a Grails/Flex with ReST and couldn't be happier!
Mike Sickler
+2  A: 

Check out springsource.org's new Spring BlazeDS Integration Project

Spring BlazeDS Integration is a new addition to the Spring portfolio, and a component of the complete Spring Web stack. This project's purpose is to make it easier to build Spring-powered Rich Internet Applications using Adobe Flex as the front-end client. It aims to achieve this purpose by providing first-class support for using the open source Adobe BlazeDS project and its powerful remoting and messaging facilities in combination with the familiar Spring programming model.

Stu Thompson