1 person found this helpful
There should be no references to the view within the other tiers, so you don't want to give the model knowledge of the movie clip. There are few different strategies for view component interaction and notifications. Using a manager or presenter for handling communication for the view component.
Here is some reading on different strategies:
Thanks ixab001! People in the forums always talk about PM's; now I know
what they are. I'll explore these articles some more and try to implement
them. Based on the little I've read, I'm assuming I'm going to have more
Classes. Since using Cairngorm, my filesystem has grown substantially. I
already have 30 classes and I'm a quarter through the project. I'm making a
class for every CaringormEvent that goes to the front controller and a
corresponding command (although I do have some commands taking in different
CaringormEvents); even so, it seems a little much. Do you have any
strategies (or know of any good articles) for lowering the class count, or
is spreading out responsibility like this what I want? Any help is
1 person found this helpful
Well, strategy and design in app development is a huge topic, and there's a lot of opinion mixed in with facts. How you approach your design depends a lot on what practices you subscribe to, how comfortable you are with different aspects and patterns of OOD, the size of your app, the size of your team, etc. To give a general, short answer, I would personally recommend following the Single Responsibility Principle as much as you can. Even on a small app or code base, keeping classes from getting too busy helps readability, prevents dependencies, reduces overall complexity, and improves maintainability.
This practice is the "S" in the S.O.L.I.D. mnemonic.
While you're at it, I'd recommend reading up on clean coding practices (esp the book by the same title by Robert Martin).
All of those resources will help you decide for yourself what engineering approach you should take.
I have another specific example I need some help on...
Going to the MovieClip that I'm using for my view (two posts ago), I am trying to keep track of the current frame the MovieClip is in. I now have a PM for my view. From what I've read in various blog posts, the PM is not supposed to be coupled to the view. Does the view have to dispatch a CairnEvent to the front controller and into an appropriate control object to change the PM? This has to happen for every EnterFrame event? I know controller are supposed to mostly take user interaction and translate it, but I seem to encounter many instances where I want to keep track of system events. (A movieclip's current frame is considered a system event, right?)
Inside scoop: I'm working on my own on this project and it's a pretty big project (atleast for a 1 person job) Just so you know
Anything helps, thanks.