Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / Re: Concept of 'ViewController' in a PureMVC application on: May 24, 2010, 08:03:53
Interesting you posted this the day I was thinking the same thing.  I am also coming from an AS3 environment.  I also noticed the Controller in Objective-C has a different role then in most MVC frameworks I have used.  It seems, so far to me, it acts like a mediator for the Model and View.  And the Model and View do not directly communicate with each other.  There is an experienced developer (Codemonkey) from Ultrashock.com, and he claims that the one thing a MVC framework shouldn’t do, is to have the View write to the Model.  Other then that, most behaviors are permitted between the triad.
2  Announcements and General Discussion / Getting Started / Re: Does a Proxy need to foster a VO? Can't I just use the native AS3 XML Object? on: April 15, 2010, 06:32:54
If other developers (if any) and yourself are comfortable and confident that the data (XML) will be conformed as expected, then I suppose its…ok.  But if the XML contains URLs for assets, how are you going to load them without violating the MVC pattern?  You wouldn’t want the View to be taking this raw data and loading assets by itself.

At any rate, its good practice not to rely on the structure of data.  If the data is not structured as expected, then your application most likely will not behave correctly.  If you deserialize your data into strong-typed value objects, then you are closer to having a more robust application that could handle data that is incorrectly structured for your application.  Creating VOs, using E4X is fairly easy to do.  When you do have fully loaded VOs (contains data from assets) Flash Player will naturally allocate more RAM.

I am hoping you or someone else can chime in on how to purge VOs.  I have an application that deserializes all data into VOs and eventually they get assets injected into them.  After the user has visited all states of the application the Flash Player allocates close to a gig of RAM.  So I obviously need to purge the assets to free up RAM and rely on the user’s browser cache to retrieve them if needed later on.  Is there a preferred pattern to do this?
3  PureMVC Manifold / Demos and Utils / Re: Loadup for Assets - A PureMVC AS3 / Flex / Loadup Utility Demo on: January 10, 2010, 05:56:57
Hello, what would be the preferred way to fire the following notification multiple of times for this example?

sendNotification( ApplicationFacade.LOAD_ASSET_GROUP, loadingInstructions() );

For instance if the initial line above returned several images and a XML file and if this XML file contains several other URLs for images to be loaded by the Loadup utility, how would I send a second request?

I did commented out the following lines below in the GroupOfAssetsMediator's onLoad method:

//loadBtn.enabled = false;
//loadBtn.removeEventListener( MouseEvent.CLICK, onLoad)
//controlsDisplayComponent.removeChild( loadBtn );


...and then in the AssetGroupProxy's removeAssetProxies method, I had to explicitly remove the Group proxy, as the following:

facade.removeProxy(ApplicationFacade.GROUP_ASSETS_GROUP_PROXY_NAME);


This seems to work but I am not sure if this is breaking the underlying pattern, what do you think?
4  Announcements and General Discussion / Architecture / Re: Any need for an Event type and/or Data type in PureMVC? on: April 19, 2009, 02:28:34
I started off 2 months ago with that tutorial!  I wanted to learn just PureMVC and when I was half way thru it, I realized I needed to learn XIFF.  Now I am doing an IM application in Flex.  Its coming along, but just ran into a crux last week with it.

The reason why I asked the question in my original post is because, documentation for XIFF (beta version) is scarce.  I see that it has a data and event package, but I am unsure on when and how to use them.  So I think, I am going to take another attempt to implement them into my project.  But if the attempt ultimately fails, then I will use custom value-objects.

Thanks again.
5  Announcements and General Discussion / Architecture / Any need for an Event type and/or Data type in PureMVC? on: April 16, 2009, 05:42:54
Is there any need to use an Event type and/or Data type between the 3 tiers in a PureMVC application?  Some 3rd party libraries seem to use them, however, in most if not all examples from puremvc.org uses just value-objects and enums.  In other words, if the 3rd party library (such as XIFF) uses an event type and data type, should I use them instead of value-objects and enums?  Or should I use both? 

Thanks.
6  Announcements and General Discussion / Architecture / Re: Decouple or Strong Type? on: April 15, 2009, 02:48:39
Yeah, that makes sense.  You explained it very well.  Thanks again.
7  Announcements and General Discussion / Architecture / Decouple or Strong Type? on: April 13, 2009, 05:04:03
Should a controller be decoupled from a model, by using primitive types or should the parameters that are passed to the model should be received strong typed? 

If I recall correctly, I read that the model, view and controller, should be decoupled as much as possible for that they may be used for another application.  So when an event gets passed into a controller, it will extract the  data from the event and break it apart to its primitive type to be passed to the model.   Is this correct?  Or should the model receive the parameters from the controller strong typed?   Or is this correct?

Thanks.
8  Announcements and General Discussion / Getting Started / Re: AS3/Flash Where to put code for visual transitions on: April 08, 2009, 01:03:34
Does this navBar act like the one in Flex?  In otherwords, does it have a property that holds the container you mentioned?  If not, I would suggest to created a new component that will use this navBar for the controls and then have the container as a value for its dataProvider, just like Flex's NavBar.
9  PureMVC Manifold / Standard Version / Re: View vs. Mediator: What code goes where? What, exactly, should a View do? on: March 27, 2009, 07:16:27
At the time I posted, I failed to realize that MXML components can inherit from other custom components.  Perhaps, I thought MXML components were different in some way then a class file.  Which is strange, since I always poke around in the generated files.  Thanks for clearing that question up. :)
10  PureMVC Manifold / Standard Version / Re: View vs. Mediator: What code goes where? What, exactly, should a View do? on: March 22, 2009, 08:19:40
Hello, Cliff you replied to Jason:
“Try not to make the mediator [my emphasis] do .NET style 'code-behind' where the component is dumb and the code-behind class contains the logic.”

This makes sense in the context of the question Jason asked (what is the purpose of a View and Mediator), however do you prefer in an addition to Mediators, we have code-behinds for Views?  So there would be 3 players in this question, the View, the code-behind and the Mediator.

The View would take care of cosmetic logic, such as to reset a form after its been submitted and perhaps tween effects.  The code-behind would take care of functional logic such as, bundling up the form data and propagating the event to the Mediator, which in turn will send its notification to the application and may call something on one of its other View components.

The reason why I ask, I wouldn't think that it will be ideal to shoe-horn cosmetic and functional logic all in the View component (MXML file).  But then again I wrote whats above a week ago, so I am really unsure.

Cliff, thanks so much for your time.
11  PureMVC Manifold / MultiCore Version / Re: Modules and PUREMVC on: March 19, 2009, 12:47:00
To answer your first question, I started by following ¾ the way through Dave Keen's tutorial (@ www.actionscriptdeveloper.co.uk ) using PureMVC with XIFF.  I didn't no anything about this framework (PureMVC) and library (XIFF), however it allowed me to throw clay on the potter's wheel and make something from it.

After using Cairngorm for 6 months on a project, I can now say that I believe PureMVC is better to work with.  PureMVC doesn't have that tight-coupling between the Model and View which exists in Cairngorm, which ended up being a problem on that 6 month project.
Pages: [1]