Flex Pasta » Penne Diagram

Penne Diagram

After many requests, I have posted a Penne Diagram.  The diagram is created in Flex and is interactive.  Click on the appropriate links and see the source code with each part of the diagram.  The example source code is from the Italian Store created during a previous post.  Remember, the framework is not set in stone.  Post suggestions to improve it!  The framework is designed for enterprise Flex applications and is meant to be as lightweight as possible.

Click to open Penne Diagram

9 Comments

  • 1. David replies at 2nd August 2008, 9:37 pm :

    It no worky for me!

  • 2. Brian Telintelo replies at 4th August 2008, 7:15 pm :

    Sometimes firefox doesn’t render the swf for some reason. Try clicking on the link to open it in a new window, or use IE(sorry).

  • 3. Ansury replies at 4th August 2008, 8:58 pm :

    Works fine in Opera. :p

    I’ve been pretty certain that Cairngorm could be improved on (in terms of developer efficiency) since the first time I used it. I think this is much easier to learn than Cairngorm, and it cuts out a good amount of the repetitive ‘copy/paste’ code that you have to deal with otherwise. (Really makes you feel like a chummy programmer doing that all the time..) So I think this is a pretty good refactoring of Cairngorm’s architecture, nice job.

    My two concerns so far are:

    1) There’s still some ‘cookie-cutter’ (copy/paste) code in the response handler code–the singleton getInstance() functions. I’m starting to wonder if there’s a way we could pull that out entirely, maybe using a base class that you’d have result handlers extend. I think I have an idea of how that could work but I’d need to try it to make sure I’m not forgetting something key.

    2) File structure organization under the “remote” folder where the request/response code goes. Large applications are going to need a more ’scalable’ file structure. It works fine for the small example, but even a few dozen interfaces or res/resp handlers in those folders is just too much. Particularly the interfaces sitting directly in the /remote folder, they’ll have to be segregated somehow and I can’t really decide (yet) how best to do that.

    I like how we’re able to use a default fault handler. I actually created a base class for my Cairngorm classes that provided a default implementation of fault() because I thought it was lame having all that identical code.

  • 4. Ansury replies at 4th August 2008, 9:08 pm :

    Another question relating to 1) above would be, does the response class even need to implement a singleton pattern? This might be shortsighted, but I’m not 100% sure if there’s a downside to simply using static variables for the model and eliminating getInstance() entirely. Maybe this would cause issues with Flex bindings, but I’m not sure.

  • 5. Ansury replies at 4th August 2008, 9:21 pm :

    Hmm, too bad AS doesn’t have abstract classes.

  • 6. Brian Telintelo replies at 5th August 2008, 9:21 pm :

    1) Can’t really pull out the getInstance code into a base class because then everywhere you used it throughout the application, you would have to cast it, which I think is more painful, however, I like the way you think.
    2) You could just create more folders under remote/request etc that break up the different chunks of the application.
    3) I don’t think bindings work with static variables. I cannot think of the reason why right now but I do know the compiler gives a waring if you try and do it.
    3) No abstract classes but there is an enhancement request open for it: https://bugs.adobe.com/jira/browse/ASC-3379

  • 7. Ansury replies at 12th August 2008, 12:29 am :

    Yeah I’ve found myself wanting abstract classes a few times, I voted for that enhancement!

    What version of FB gives you a warning for static bindings? I can’t reproduce that, although I would suspect that it may cause binding “issues” (or it just isn’t supported) if I had to guess.

  • 8. Ansury replies at 10th September 2008, 4:05 pm :

    Thought of an issue relating to eliminating a standalone ‘model’ singleton: Where do you put things like ViewStack indexes, which may be changed by multiple request handlers? With no central ModelLocator deal like Cairngorm offers, it’s not so easy to have server responses move the user to different views. Of course, Penne doesn’t stop you from still using a ModelLocator/singleton for this purpose.

    Also another issue along the same thinking: What about clientside-only data such as data generated using server data? Or data that the client stores but doesn’t send to the server? Or lists of data that the client ‘records’ from the server? What if the data is arriving from a Flex messaging service instead of a remoting call that has a response class? Or recording the local username of the client after they login? (It seems a little strange to be accessing the ‘login’ remote result all throughout the application to fetch the local user’s username.)

    There seems to be some legitimate uses, still, for a ModelLocator/singleton model for a select portion of data. Does this make sense?

    By the way has this been tried out for any large or medium sized applications yet?

  • 9. Brian Telintelo replies at 24th September 2008, 7:09 pm :

    Ansury,

    Excellent points and well thought out. I don’t necessarily have the answers to those questions. But here is a few thoughts:

    Where do I put a “model” variable for a viewstack in Penne since the “result” class doesn’t make sense?
    1. We could just have model classes for all data/singleton variables just like with Cairngorm and not use the “result” class of Penne to handle this.
    2. We could create a separate singleton class just for view stack, tab navigator, etc navigation and data binding through out the application.
    3. What other options are there?

    I don’t think there is a wrong or right way to do this, as long as it is consistent. The reason that the “result” classes of Penne are used to hold the data is for ease of maintainability. It is easy to find what variable is coming from where if it is in the “result” class.

    I agree with you that there are still uses for the ModelLocator/singleton pattern as it is in Cairngorm. If the needs is there then let’s consider adding in to Penne.

    I am currently working on a project in which I hope to introduce Penne to a spinoff application that is just getting started. I’ll keep you posted on how it turns out.

    Brian

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>