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 ... 3 4 [5] 6
61  PureMVC Manifold / Standard Version / Concrete mediators and the viewComponent on: July 29, 2009, 11:21:28
I've always assumed that the viewComponent in concrete mediators always references the Main class(passed in via  a notification body in the StartupCommand).

But on page 34 of the best practices document, I see the LoginPanelMediator constructor has the Loginpanel view as the viewComponent.

http://puremvc.org/component/option,com_wrapper/Itemid,30/

Can someone shed some light on this?

This might explain why  I'm having a heck of a time getting the implicit getters setters working properly...
62  Announcements and General Discussion / General Discussion / Using implicit getters in concrete mediators on: July 29, 2009, 05:24:48
p35 of the best practices document
http://puremvc.org/component/option,com_wrapper/Itemid,30/

If I try duplicating the example, using the following in my LoginPanelMediator, loginPanel traces null. Also, shouldn't viewComponent in the implicit getter reference the Main class , passed in thru the body of the StartUpCommand?


//CODE START
// User clicked Login Button; try to log in
private function onTryLogin ( event:Event ) : void {

trace('loginPanel==='+loginPanel);//traces null
sendNotification( ApplicationFacade.LOGIN, loginPanel.loginVO );
}
// Cast the viewComponent to its actual type.
protected function get loginPanel() : LoginPanel {
return viewComponent as LoginPanel;
}

//CODE END
63  Announcements and General Discussion / Getting Started / Q:Communicating state between different proxies at runtime on: July 23, 2009, 06:26:45
Hi
This is related to the cross-referencing proxies post but not quite the same issue I believe.
I am also a novice PureMVC'er so for my first app want to avoid using StartupManager or any other PureMVC utlities.

I have 3 proxies, 2 that handle uploading and saving of images to a remote server, and a third that manages user login, registration as well as current application 'states' defined as static constants.

My 2 'image' proxies need to communicate their 'state' to the UserProxy.
Would the simplest solution and best practice be to simply define a 'SiteProxy' which all 3 proxies extend?
And to define my static 'state' constants in this SiteProxy so that ALL proxies know about them?
Or should my existing proxies retrieve an instance of each other via the facade?
64  Announcements and General Discussion / Architecture / Tracking implementation on: July 22, 2009, 04:17:02
In several projects I have worked on tracking logic has been requested by the client AFTER the site went live, ie tracking was never part of the original functional spec.
By tracking I mean all user interaction such as button clicks, form entries, and, if the site is composed of subsections, sections viewed, as well as client specific hardware-software data accessible via the Flash api.
For instance Google Analytics
http://www.insideria.com/2009/02/using-google-analytics-within.html

Can someone tell me if tracking can be easily implemented in a PureMVC application AFTER the project is complete, and if so, would any of the original 'actors'(proxies, mediators, controllers) have to be modified, or would they be supplemented with additonal actors?
For example, I assume it would make sense to have an additonal 'TrackingProxy' but not sure if existing mediators would need to be modified or if there was some other way.
65  PureMVC Manifold / Standard Version / Re: PureMVC (single core) as3 project templates for FB 3, Textmate, Flashdevelop on: July 21, 2009, 12:53:19
Ok, found 1 for Textmate
http://www.typeoneerror.com/puremvc-textmate-templates/

I assume there aren't any for Flexbuilder yet?
66  PureMVC Manifold / Standard Version / PureMVC (single core) as3 project templates for FB 3, Textmate, Flashdevelop on: July 21, 2009, 12:49:45
Hi
Can someone tell me where I might find any existing as3 project templates for FB 3, Textmate, flashdevelop?
67  Announcements and General Discussion / Architecture / Re: Using a simple shell swf loader in a puremvc app on: July 21, 2009, 09:01:36
I think perhaps the answer is simply to ensure your main content swf has a stage reference BEFORE you call the startup command

So in you main swf
addEventListener(Event.ADDED_TO_STAGE,onadded);
trace('BEFORE onadded stage==='+ stage);


function onadded(e:Event):void{
   ApplicationFacade.getInstance().startup( stage );
   trace('AFTER onadded stage==='+ stage);
   
}
68  Announcements and General Discussion / Architecture / Using a simple shell swf loader in a puremvc app on: July 21, 2009, 08:41:30
Can someone calrify how I would use a simple shell loader as outlined in Lee Brimelows tutorial
http://www.gotoandlearn.com/play?id=85

As I understand it, everything in a PureMVC app starts with the startup command, called via your main document class via application facade.

But using Lee Brimelows shell loader technique requires at a minimum 2 swfs, your preloader shell, and the main application swf you are loading.

Where would the following code go
ApplicationFacade.getInstance().startup( this );

in your preloader 'shell' swf (only called after your main swf has loaded),
OR
in your main application swf?
69  PureMVC Manifold / Standard Version / Q;Correspondence of remote proxies to mediators on: July 20, 2009, 07:31:17
I understand there are several 'right ways' to organize your classes in a PureMVC, but I'm looking for general best practices to help when initially architecting an application.
For instance, I know I will need at least 3 different remote proxies for the app I am building. A UserProxy for registration and login, an UploadImageProxy for initial image upload(from the desktop), and a CreateImageProxy to save the modified image data to the remote server.
Does this imply I will need corresponding mediators, or is the mapping of proxies to mediators arbitrary? ie in the above example I was considering the following
- a 'header' mediator that houses global items and listens to 'login' events in a corresponding 'header' view, and then retrieves and interacts with the UserProxy.
- a CreateImage mediator which interacts with (directly or via commands) BOTH the CreateImageProxy and the UserProxy since this CreateImage mediator also contains- a registration form view component.

If I were to add a publicly viewable gallery view component, would that imply a corresponding GalleryProxy(to retrieve the images) as well as a corresponding GalleryMediator?
70  Announcements and General Discussion / Architecture / Q: How much logic should remain in view components?? on: July 20, 2009, 03:25:36
Hi
I'm trying to keep things as simple as possible for my first PureMVC application and would appreciate any input.
I understand the need to keep the view components as simple as possible but am confused as to when you should refactor the logic out of the view and into one of the other core PureMVC actors.

A simple example
Arrow buttons on the stage that, when clicked, simply moves an image in the corresponding direction....no change to the application logic, simply updating the view.

Ok, now instead of arrow buttons, we have a scrollbar that when scrolled, changes the opacity, saturation, rotation value, etc of the image.

What core PureMVC actors would be required and what would there repsonsiblities be?
I've read all the best practice documents and I can still see several ways of accomplishing the above....

For instance in the 'minmalist example'
http://www.as3dp.com/2007/12/27/minimalist-mvc-example-using-the-puremvc-framework/
it seems like overkill to me to have a seprate proxy just for keypresses...am I wrong?


71  PureMVC Manifold / Standard Version / Distinction between business vs domain logic on: July 14, 2009, 03:30:43
Can someone give a few examples of typical 'business' vs 'domain' logic?
Not quite clear on this distinction although I understand that best practice is to keep all domain logic in the model-proxies and business logic in the controller-commands.
72  Announcements and General Discussion / Architecture / Q:Need help in architecting a non Flex application on: July 14, 2009, 03:26:53
I am building a Flash AS3 application comprised of three main parts or sections.

The first is an application that allows users to upload and modify images, and then submit-save them to a server after they have registered.

The 2nd is a publicly viewable gallery of images from all users.(linked to from the home page of the 1st section above)

The 3rd is a private admin tool, which a user access after logging in.(they must already have registered-submitted a photo). This tool will simply allow a user to changer their email password as well as delete any images they have uploaded.

I am comfortable both with standard MVC as well as all the functionality needed for the view components having built something similar in AS2 and Flash 8 a few years back. But I am considering using PureMVC for this project but don't know where to start.

Can someone with actual expereince in building something similar briefly describe what various PureMVC 'actors' I will need for this application and what their roles would be?
I do know I will need to make use of Remote Proxies (and HTTP Service??) for the login and registration forms(and probably for the initial image upload as well)
When does it make sense to use a custom loading utility such as the Startupmanager?

What existing Actionscript -Flash IDE PureMVC project demo(s) or tutorial(s) should I reference?
Especially will need help with image upload- login as well as registration.

Any help or feedback apprecaited!
73  Announcements and General Discussion / Architecture / Re: Simple site loading 2 or more types of data on: July 11, 2009, 01:46:14
Hi Cliff
I realize what you are recommending is a best practice, but, for someone who is new to PureMVC, I feel the simpler approach( encompassing the logic for different datatypes) into one proxy makes sense until I am thoroughly comfortable with the framework.

Just a suggestion, perhaps there should be recommedned practices for beginners vs more experienced users?
74  Announcements and General Discussion / Architecture / recommended mappings of commands to proxys on: July 11, 2009, 11:56:11
Right now I have just one  command with a switch case statement handling all my communication from several mediators to one Proxy.

But I am refactoring to have separate proxies for each type of data I am dealing with.

I assume then that my single command must be split up, one command per proxy since each command only knows about one proxy.
Is this a recommended best practive?
75  Announcements and General Discussion / Architecture / Re: Simple site loading 2 or more types of data on: July 11, 2009, 08:55:17
Ok thanks Cliff, will try refactoring according to your suggestions.


Right now I only map notifications to commands when I'm updating the proxy-model.

Not sure why you need to use commands when the information flow is FROM the proxies to the mediators, aren't the notifications sufficient?
Just trying to avoid any unneeded complexity...
Pages: 1 ... 3 4 [5] 6