views:

143

answers:

1

I'm looking for a comprehensive setup that you've successfully used already. I've already loads of hints as to what building bricks I might use, but I'm not sure how to put it all together. Tools that need to be bought are OK, too.

Details:

I'm developing a Flex front end client for a Java server application and I have a set of model classes that represent objects in my business logic and should have the same properties and exhibit the same behaviour throughout all layers. These objects

  • have form validation logic for user input
  • are displayed in various forms (lists, detail views ...) throughout the UI
  • are retrieved from and sent to the server using XML or AMF
  • are validated again on the server
  • are stored in a RDBM with tables and fields corresponding to the classes and fields

This is a very common application structure, I guess. I'm already using:

  • ORM for the Java backend (Eclipse persistency package)
  • automatic mapping from XML to Action Script, using XML schema and the classes in mx.rpc.xml, as described here.

Now, what I'd really like to do is define the objects once (I already have them in XSD) and have tools set up class stubs for the whole chain. What can I use?

I've already heard of (but not evaluated):

  • XMLBeans to generate Java classes from XML Schema
  • Granite DS to generate AS classes from Java classes
A: 

I don't think your Flex UI should know or care about Java objects.

Take a "contract first", XML schema-drive approach and come up with the messages that you need to exchange between the Flex client and your service tier. Once you have that in place, the two are completely decoupled. That's a good start.

I'd also recommend not buying into a generation scheme. You'll only have to pay that price once during development.

I'm a Spring user, so I'd recommend Spring's "contract first" web services, using the Spring OXM interfaces. That will keep your UI and service tiers nicely decoupled. Use the org.springframework.oxm interfaces to do your mappings.

You can use Spring/BlazeDS to integrate your Flex UI with the Spring back end.

You have the full power of Spring IoC and AOP to create the back end.

I think you'll find it's a good approach for this problem.

duffymo