Wanted to add that I use my own custom MVC micro-architecture which is based on
(a mixture of) ARP and Cairngorm.
Back when I was still developing in Flash (before I moved to Flex) I used ARP by Aral Balkan, which as far as I know was the first
real MVC framework for Flash.
Not even sure if there is another :)
Unfortunatly ARP no longer exists, well at least it's no longer being
developed/updated.
There's still some info up on the osflash.org site:
http://osflash.org/projects/arp
But, the most important thing about ARP - at least to me - was the documentation that came with it and I can't seem to be able to
get my hands on a working copy.
The online version is down and the downloadable version (exe) for some reason doesn't work properly (I'm guessing it's hooked up to
the online html version or something).
http://osflash.org/downloads/arp/ARP_2.02_Manual.exe
If someone can get it to work, I'd love to hear about it.
The thing is, it contained a great explanation of how MVC applies to Flash. It explained all the relevant design patterns very well,
including Model, View, Controller, Command and ServiceLocator.
If you download the ARP sources + samples, you can still see how it works (and
use it if you like).
http://osflash.org/downloads/arp/ARP_2.02.zip
regards,
Muzak
- Original Message -
From: "Peter Ginneberge"
To: "Flash Coders List"
Sent: Wednesday, February 29, 2012 4:25 PM
Subject: Re: [Flashcoders] MVC style Correction
Here's what I use.
packages:
- business
Contains singleton with services (RemoteObject, WebService, HTTPService,
SQLite), used by Command classes.
- commands
Contains commands that are executed by the Controller when a matching event
is triggered.
Commands are responsible for fetching data from server and storing it in the
model.
- control
Contains AppController (singleton) that wires custom events to commands.
- dto
Date Transfer Objects (aka Value Objects). These get passed around with
custom events and are stored in Model, etc.
- events
Custom events, usually dispatched by views. Controller listens for these
events and executes matching command.
- model
App models. Dispatches change event when data changes.
- view
App views.
==
Where would you expect transfer object class
dto package
Where would you expect a custom event class?
events package
Where would you put a class that reads from and writes to the file system?
commands package
What about a class that holds string values to display ion dialog boxes, on buttons, etc? Is that part of the view or should it
be defined in the model?
Not in the view and certainly not in the model.
Most likely a static utility class -> package: utils
regards,
Muzak
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders