Chapter 9. Holding state on the client properly
One key shift in mindset when you move from the development of web applications to rich Internet applications is that the client is stateful....
If you have been building desktop or rich-client applications with technologies such as Swing or AWT, for instance, you’ll shrug your shoulders right now because all of this will sound all too familiar—it is.
Steven Webster[1]
If you’ve spent any time building Flex applications with Cairngorm, or with any desktop UI framework such as Java Swing or Windows Forms, the thought of storing the data on the client as just XML (regardless of how cool the E4X way of dealing with XML is) is unsettling. Surely we should be creating and using a proper object model on the Flex side.
Furthermore, right now all the Flex code is tightly coupled to the fact that we’re sending and receiving XML. However, what if we wanted to use JSON or YAML to send data to and from Rails—or even AMF (using RubyAMF or WebORB)? This should be a straightforward change, but as the code stands currently we would essentially need to do a massive refactoring of most of the Flex code. Obviously this is unacceptable.
Yes, we should probably be creating and using a proper object model on the Flex side. Not only will this result in better code, it will also decouple us from using XML.