A recurring theme on forums like flexcoders is the issue of user interface architecture within Flex applications. Rich-client applications developed using frameworks like Flex are something of a departure from ‘traditional’ web applications, so the architectures employed for such applications will inevitably differ. But not so long ago we were comparing the new concept of web-application development with that of ‘traditional’ rich-client applications and arriving at very similar conclusions. We have come full circle, from rich-clients to web-clients and back again. So what lessons can we learn from the 20 or so years of rich-client development preceding Web 1.0? And are there web-application patterns that translate across to the rich-client world?
Martin Fowler is one of the most vocal commentators on UI architectures and he describes a number of contrasting patterns over on his website. Many of the patterns he discusses are aimed at the organization of presentation logic.
What is presentation logic?
There’s a rich variety of application ‘concerns’ that could be covered by the term ‘Presentation Logic’. Here are a few possibilities:
- Animation / Rendering
- Dynamic view creation (eg. pop-ups)
- Responding to user input
- Progressive reveal / disclosure
- Navigation behaviour
- Deep linking
- User input validation
- Display formatting
- Localisation / Internationalisation
Some of these are more closely related to the graphical environment than others.
What’s the plan?
I want to take a closer look at Martin Fowler’s presentation patterns, and I’m also keen to review some of the more popular patterns in the Flex world. To help me compare and contrast the patterns, I’ll build the same example application using each one. This application is based on Fowler’s album-browser example. I’ve ‘Flexed’ it up a bit, but it is still very simple - no remote services, no domain models, no business objects and no frameworks (except Flex). I will touch on the subject of unit testing when comparing architectures, but in the interests of blog-entry-brevity I’m going to leave a full analysis of ‘testability’ for another day.
First up: Autonomous View