18
Aug
2005

Flex/Flash Architectural Challenge

This discussion about MVC in RIAs has made it clear that different people can mean slightly different things when they talk about MVC. Once we got down to specific examples, the differences seemed to disappear.

So let’s get even more specific. Suppose you were building a Flash/Flex version of Ta-da list. What would the appropriate client side architecture be? What classes would you have, with what responsibilities? If you haven’t seen the app before, check it out. It’s a small, convenient app made by the folks who put together Ruby on Rails.

My personal belief is that for an application of this scale, you could build it cleanly without a controller, and that the code may be simpler as a result, but I could be totally wrong. In the meantime, prove me wrong! (or better yet, prove me right!) Tell me how you would build it.

I’ll offer a Macromedia T-shirt (hopefully a Flex/Zorn shirt, although we don’t have any yet…) to the person who contributes the best ideas to this thread.

Full disclosure: If you feel particularly territorial about your ideas or code samples, please be warned that any insights you give may make their way into Macromedia samples / documenation / etc. In other words, please don’t share anything you don’t want us to share with others.

5 Responses to “Flex/Flash Architectural Challenge”

  1. romain faraut

    Hi Sho,
    for me the whole MVC debate is a Nail/Hammer problem . I think nobody will tell that MVC is the best to fit all Flex projects sizes. TaDa List is a very basic application. Do you think MM is selling Flex only to build “TaDa lists”-like applications ?

    The product have a full potential for many Intranet workflow processing or data management applications, it is short-seeing to reduce it to a TaDa List builder…

    If you need to compare code between MVC and non MVC, please compare code of the original FlexStore and the Cairngorm i2-built version. Compare coupling, readability and maintainability, keeping in mind that FlexStore is still a small-size application.
    [off course I’m biaised beeing a Cairngorm committee member]

    Cheers, r0main

  2. Martin Arvisais

    Hi,
    ot make it quick, I will create a big board where my todo list will be there with the form of postIt.

    I will have a side control to modify the selected todo Note.

    important also is to include time on task, so we can setup alarm for each task…

  3. Sho

    Fair enough, Romain. I understand your point.

    Of course, the real Ta-da list *is* built using MVC, because that’s how Rails works. I was hopeful that a small example would let us discuss things in concrete terms that would not be possible if we used a large example.

    I’ll take a look at the Cairngorm FlexStore. I assume it’s at the i2 site?

  4. Martin Arvisais

    Hi,
    ot make it quick, I will create a big board where my todo list will be there with the form of postIt.

    I will have a side control to modify the selected todo Note.

    important also is to include time on task, so we can setup alarm for each task…

    So for MVC you have controler, dataModel, eventModel (broadcast note to control panel onFocus)and all the flex frame is the View ;)

    sometime you have to KISS (keep it simple and … simple)
    For the MVC part…

    Note will be flash component (swc) built with some AS 2.0 class, and graphic built with the good old graph tools LOL

    Flex side…
    A controler built dynamic note with notePanel.createChild();

    Each note will be a flash component inside a flex component attach to a where the note ask is data from a controler.

    This controler take communication to the middleware script that talk to the Database… like cfc with remote connection.

    So you will have your flex frame (control, panel,etc) and the note board.

    A FCS connection can be add to make note live to all user connected, and use the pushing data to update note live…

  5. Sho

    Thanks for that, Martin!

    To be clear.. what responsbilities would the controller have? Just note creation, or would it also be involved with, say, editing and deleting notes? How are user events wired up to the controller? (events?)

    What about operations that take place within the note itself (such as reordering items)? Is that taken care of by a controller for each note?

Leave a Reply