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  PureMVC Manifold / Multicore Version / Caching references to other proxies in a proxy on: May 21, 2012, 11:54:51
Hi all

Sometimes it's handy to cache references to other proxies in a proxy, so you don't have to do a lookup (facade.retrieveProxy) each time you need data from that particular proxy.

But I am unsure where to put the reference in the Proxy pseudo class in the native port.

So my question is;

Where would I put something like:

this.userProxy = this.facade.retrieveProxy(app.model.proxy.UserProxy.NAME);

In a proxy?

2  PureMVC Manifold / Multicore Version / Event dispatching from view components on: May 10, 2012, 05:50:36
Hi All

I am well familiar with PureMVC in an ActionScript context, and would like to use it for JavaScript as well.

I've looked at the reverse text example, but that uses an implementation of event dispatching that's pretty restricted from my understanding (in a browser compatibility sense).

My question is; How do you do event dispatching from view components (DOM objects) to their mediator natively (or alternatively in jQuery)? The mediator is not part of the DOM so I don't understand how the event would propagate?
3  Announcements and General Discussion / General Discussion / FlashBuilder templates for PureMVC on: September 15, 2010, 12:39:15
Hi all

I use FlashDevelop for developing Flash applications. I also use PureMVC on all my projects. Thanks to the template system in FlashDevelop I never have to write any PureMVC boiler plate code.

Now I'm thinking of switching of Flash Builder because it offers some nice features, but from what I understand the template system in Flash Builder might as well be non-existent (I don't need to change the Class definition profile for all my classes in a project, I want to be able to choose "new > Mediator").

Is my understanding wrong? If no; How do the people working in Flash Builder generate their boilder plate code?
4  Announcements and General Discussion / Architecture / Architechture for larger database driven sites on: August 30, 2010, 07:31:35
Hi all

I've been wondering for a while how others architect database driven websites.

My current approach is to have the backend output a site tree where the nodes represent the pages in the site. Each node then specifies:

An id - obviously an unique id for the page (for searching the tree), I normally use the path to the node in the site tree and use this for SWFAddress as well (for example: id="clothes/shirts/blue-shirt")
A template - the view that is needed to render page data.
A data url  - the data for the page (the template will know how to render this)
(and an optional "includeInMenu" attribute)

Every time an url is entered the template specified view is then instanciated and the data for the view is loaded and off we go.

This approach works fine for most cases but it doesn't scale very well, and the very concept of loading the entire site map seems wrong since a user never really visits the entire site.

So how do you guys handle dynamic sites? (deeplinking to states is required)
5  Announcements and General Discussion / Getting Started / Number of mediators registred? on: August 19, 2009, 04:39:29
Hi All

I am doing an app that constantly registers mediators and throws them away again, and for debugging I would like to see if the total number of mediators registred increase (which they shouldn't in my app).

Is there a way of asking the facade how many mediators are currently registred?

I'm sorry if this is a documented feature I've overlooked.

Regards
6  Announcements and General Discussion / Getting Started / May a view component load swfs? on: August 13, 2009, 01:22:55
Hi All

I've previously asked whether a view component can load it's own external images without breaking best practices or not. The answer was that it could.

Does the same go for swf files that implement an interface that allows the view component to control them?

I'm thinking the external swf's are subcomponents of a specific view component.

Regards
7  Announcements and General Discussion / General Discussion / where to put a global dictionary on: July 23, 2009, 07:13:30
Hi All

I have a project where the various view components need to reference a global dictionary for common phrases (like "more info") - the site is versioned for more than one language.

The question is where to put this object.

My plan is to the have the method to retrieve a phrase as a public static method, so everybody can access it, and I was thinking I would keep it in my "contants" folder, and populate it from the proxy that loads all the globals for the site.

Does that make sense?

Regards
8  Announcements and General Discussion / General Discussion / Object pool used by view components on: July 16, 2009, 06:54:31
Hi All

I have a potential monstrous amount of text fields being created and removed at runtime, and they all need a non-system font, which means that I need a TextFormat object for all my text fields.
So I thought I'd just create a TextFormat object for each color and size and font (instead of one per text field) and reference them instead of creating new ones.

My problem is where to keep them. Would it be ok to store them in a Proxy and let a given view components mediator fetch the TextFormat object when needed?

Regards
9  Announcements and General Discussion / Getting Started / Can view components load images? on: July 12, 2009, 02:03:53
Hi

This is probably a stupid question, but is a view component allowed to load the external images it needs (using Loader in Flash)?

Regards
10  Announcements and General Discussion / Getting Started / notifications, commands and mediators on: July 12, 2009, 02:01:20
Hi All

If a notification has an associated command and a Mediator is interested in this notification, what is the order of execution?

Say the command modifies the model and the mediator needs this modification. Can this be handled on the same notification (by order of execution) or should it be implemented using another notification?
11  Announcements and General Discussion / Getting Started / Register and remove mediators in runtime, where to put it? on: July 06, 2009, 05:50:12
Hi all

I am building this app that has various windows that display various information, say a contact form and a "find store" map sort of thing (there are more ofcourse).

Since it would be foolish to intanciate all possible view components on start up, I need to create them only when the user requests them, meaning the view components and its mediator should be instanciated and removed at runtime.

Where do I put this functionality? I am thinking of using a Command that runs every time a section changes and sets the various things that need to happen (remove the previous view components, set the new one, update swfadress and so on).

But this raises another question. Where do I store the currently used Mediator and view component? In a Proxy? And what if I need the previous view component to use a transition out and wait for that to finish, before the new view component starts its transition in? Commands can't really wait for anything can they (the transistion thing is a bit tricky for me)? 

Hope this makes sense?

Regards



12  Announcements and General Discussion / Getting Started / Stage resizing on: July 06, 2009, 04:21:06
Hi

I am building an application that needs to run "fullscreen" (as in fullscreen within the browser, not a "take over"). When the window is resized the different elements obviously needs to reposition.

For this I use at StageMediator, whose viewComponents is stage. The StageMediator listens for the RESIZE event and sends a ApplicationFacade.STAGE_RESIZED notification.

Every other mediator that controls a view component that needs to reposition naturally listens for this notification.

Heres my concern, should the repositioning logic be in the view component or in the mediator? It seems that if I put it in the component it breaks some of the reuseability as you cannot assume that a component needs these things?
If I put it in the meditors the begin to more than merely mediate, which seems to break best practice?

Does it make sense?

Regards
13  Announcements and General Discussion / Getting Started / Flash, passing stage to ApplicationFacade on: June 29, 2009, 12:50:57
In the various Flash examples I've seen using PureMVC the object sent to the application façade startup is the stage, why is this?

In some applications you don’t really need stage, and if you did, stage could always be reached through the document class instance.

So I just pass the document class instance to the application façade, is this considered bad practice, or will it have some side effects I've missed?

Regards
14  Announcements and General Discussion / Getting Started / Is my approach somewhat correct? on: June 29, 2009, 12:15:44
Hi All
I'm trying to get my head around PureMVC. I am doing it by refactoring a really simple app I've done. So I thought I would ask here if my initial approach is somewhat correct, or if I am misunderstanding certain concepts?

The app is a searchable gallery of products.

The product data is loaded from a server, and the images are also dynamically loaded.

The user can enter various criteria and the gallery is then updated to display only the products that fit the criteria.

The user can then click a product image to get more information on that product.

Thats it.

So I have 3 view components;
UserSelectionUI (containing various buttons, a combobox and a search field)
GalleryView
ProductDisplayView
(and maybe an AlertView for error messages)

These view components gets a Mediator each.

I have two proxies;
ProductProxy (which loads the xml and stores the product list)
ParamsProxy (for flashvars)

The ProductProxy is initiated from a StartUp Command, when the xml is loaded it is parsed into a list of ProductVO objects, which the proxy now stores. It then sends a notification that the data is ready.
I am in doubt as to where I should put the filtering function that find product matches based on user input. Should it be in a Command or in the Proxy, or even in the UserSelectionUIMediator?
Right now I’ve implemented the filtering function in a Command (SearchCommand). The notification for the search contains a SearchVO containing all the search settings (the properties the user has selected).

But this means that the view component (UserSelectionUI) needs to populate the SearchVO and pass that to the mediator who then ships it with a notification to the Command. That’s a lot of shared knowledge isn’t it?

The Command needs to compare the result list with the previous result list to prevent an unnecessary update of the view. Since Commands holds no state information I’m storing the previous result list in the ProductProxy, is that ok?

Are VO’s part of the model controller or view?

Hope this makes sense?

Regards
Pages: [1]