So I've got a simple web application using Spring MVC + Hibernate and am using the OpenSessionInViewFilter. I've recently been thinking of replacing the UI with something like Flex or GWT.
At first I thought it would be easy, in that I can just hit my service layer from the new front end. But as I consider this a bit more, I'm a little bit nervous about the issues surrounding lazy loading. Using a traditional web front end it's no problem because I'm using open session in view...everything that needs to get loaded for the view gets loaded as the view is constructed.
So Let's say I've got a method to return a Customer, and a Customer has a bunch of Contacts, and Contacts have a bunch of Addresses, and so on. If I call getCustomer() from my new "RIA" controller, it's going to get a Customer, but the Customer's collection of Contacts is just going to be a proxy or null.
I could create a new layer on top of what I've already got that returns DTOs which are pre-populated...but... that seems like it's going to get complicated.
Any advice?