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] 2 3 4
1  PureMVC Manifold / Multicore Version / Re: Caching references to other proxies in a proxy on: May 22, 2012, 11:22:53
Thanks for your answer, I forgot about onRegister in Proxies. I've made a template proxy from the "ReverseText" example, and I guess that was left out, from the class profile in that example.

Where do you specify constructor arguments in the proxies in the js native port?
2  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?

3  PureMVC Manifold / Multicore Version / Re: Event dispatching from view components on: May 21, 2012, 11:47:34
Thanks for the article, interesting read (and sorry for the late response).
4  PureMVC Manifold / Multicore Version / Re: Event dispatching from view components on: May 11, 2012, 04:56:40
Ok, now I've implemented the event dispatching/listening using jQuery's bind and trigger.

In the TextComponentMediator:

:
var that = this;
$(this.viewComponent).bind(demo.view.component.TextComponent.TEXT_CHANGED, function (e, data) {
     that.handleEvent(data);
});

(I hate the scope resolving (var that = this)...)

In the TextComponent:

:
$(this).trigger( this.constructor.TEXT_CHANGED, { text: this.getInputText() } );

I think I would prefer a native event model so that the event handling code wouldn't have to be specific to some JS framework (jQuery in this case).
5  PureMVC Manifold / Multicore Version / Re: Event dispatching from view components on: May 11, 2012, 01:57:22
Thanks for your answer.

Maybe it's my lack of JavaScript knowledge, but I'm still struggeling with the concept of custom events and eventhandlers.

I don't understand how you'd define and create your own events in the view component and propagate those to the mediator.

The ReverseText example creates a "TextChanged" custom event and dispatches that. From the provided link I don't see how I'd do that (in a browser independent way)?
6  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?
7  Announcements and General Discussion / General Discussion / Re: FlashBuilder templates for PureMVC on: September 17, 2010, 01:26:20
Ok thanks.

How do you specify templates in Flex Builder 3?
8  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?
9  Announcements and General Discussion / Architecture / Re: Architechture for larger database driven sites on: September 15, 2010, 12:32:09
Thanks again Cliff

Yeah the hard part is figuring out the mapping of the url to a specific application state.

One thing I forgot about using the site tree approach is the possibility for the application state to know about the states context in the tree - which you'd need to think into a url routing routine if you'd need to facilitate this.

So far I'm not sure I'll give up the site tree/site map approach, I think the routing approach still needs some thinking. I think I was hoping someone already had come up with a scheme for it :)

Maybe I'm just talking nonsens? :)

(Doesn't the StateMachine utility depend on Flex?)
10  Announcements and General Discussion / Architecture / Re: Architechture for larger database driven sites on: September 03, 2010, 01:55:54
Thanks Cliff

From what I can tell that's pretty much the approach I am using now (and what I think a lot of others are as well?).

But I was wondering if a routing approach like NET MVC where the url kan be translated to a state without knowing the entire site tree was feasible (site maps can become rather large, and often the server needs to generate them, giving overhead).

Something like:
{command}/{view}/{id}

Then all you would need to load would be a service mapping of some sort, and not a description of the whole site. (obviously you'd need a command and view map as well). And the services could be used from other clients without them having to know some arbitrary xml site map.

I'm just not smart enough to figure out if it would work and be generic enough. So I ask you guys if you have a smarter approach :)

11  Announcements and General Discussion / Architecture / Re: Architechture for larger database driven sites on: August 30, 2010, 10:52:28
Another disadvantage of the above mentioned approach is that isn't very "service oriented", and replacing clients would force them to use the site tree "protocol" instead of a more generic webservice defined interface.
12  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)
13  PureMVC Manifold / MultiCore Version / Re: Page 'redirect' in Mediator or Command? on: December 30, 2009, 01:12:37
I'm certainly no PureMVC expert, but I do think that Cliff would agree that view components can have lots of logic. A Mediator is just the way a view component has access to the system without actually knowing about the system.

I the case of loading a swf that most likely contain some visual presentation of data(?), I would usually use some container as a view component, and have that handle the loading and error handling. The mediator could pass data to this view component and that would know how to present that data.

(If the swf contains fonts I would normally load it from a proxy in a startup sequence)
14  PureMVC Manifold / MultiCore Version / Re: Page 'redirect' in Mediator or Command? on: December 29, 2009, 03:39:26
I don't think you would want to handle any loading of swf files in any mediator. That should probably be handled by a view component.

Mediators shouldn't contain logic as such, except as a "filter" on notifications, that tells some view component what to do upon that specific notification.
15  Announcements and General Discussion / Getting Started / Re: Puremvc for beginners on: December 29, 2009, 12:48:15
You've read the "best practices" document? ( http://puremvc.org/content/view/98/189/ )
Pages: [1] 2 3 4