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 / Bug Report / [WILL ADD] Suggestion for next version on: August 27, 2008, 02:24:20
Just a (very small) suggestion for the next big release of PureMVC:
It'd be very handy if the Facade's registerMediator and registerProxy methods would return the instance of the mediator/proxy which gets registered.
That way you can write this:
:
mediator = facade.registerMediator( new SomeMediator( someView ) )instead of:
:
mediator = new SomeMediator( someView );
facade.registerMediator( mediator )

I know, it's a silly and small thing, but everything which speeds up coding is welcome ;)
2  Announcements and General Discussion / Getting Started / deferred mediator registration on: May 20, 2008, 05:37:59
I don't know if anybody'll have any use for this, but I wrote a small function which defers the registration of the mediator until the view component it mediates is created.
(I hope it doesn't sin against the best practices ??)

Place this in ApplicationFacade:
:
public function deferMediatorRegistration( mediatorClass : Class, viewComponent : UIComponent ) : void{
var facade : ApplicationFacade = this;
var listener : Function = function( event : FlexEvent ) : void {
facade.registerMediator( new mediatorClass( event.target ) );
}
viewComponent.addEventListener( FlexEvent.CREATION_COMPLETE, listener );
}
to use it (in, for instance, ApplicationMediator )
:
ApplicationFacade.getInstance().deferMediatorCreation( MyCustomMediator, app.myCustomComponent );
3  Announcements and General Discussion / General Discussion / Command confusion on: May 19, 2008, 01:01:08
I'm a bit confused about the responsibilities (and use) of commands. When I look at the provided examples I notice there are examples where all remote access is done through commands ( for instance there are commands for all CRUD operations in the Bookstore example)
But then in another example (IndexCards) all remote access is done through the proxies.
I'm not sure which approach I need to take.
I'm working on an application with around 20 tables and approximately the same amount of views. If I cut up all CRUD operations to separate commands this'll give me 60+ commands. That seems WAY overkill. But on the other hand if I go for the proxy-approach, I'll only have 3 (Startup, ModelPrep and ViewPrep) and suddenly commands seem completely useless to me.
So, when should I decide to put something into a command and when can I leave it to the proxy?
(I read the chapter on commands in the "best practices" document, but I must confess that I'm not familiar with most of the expressions like 'domain logic' etc. Looking them up at Wikipedia didn't make me any wiser, on the contrary)
4  Announcements and General Discussion / Architecture / Questions about Indexcards example and registering proxies on: April 02, 2008, 12:30:26
If I understand it correctly then commands are registered to one specific notification.
When I look at the commands in the Indexcards example, 3 of them check the notification name to perform different actions.
I don't quite understand how this works. I've searched through the code and found all of the commands to be registered to one notification, so how is this possible?
Do they still receive the other notifications, even though they're only registered to one specific notification? And if that's the case, then why register them to one notification at all?

Another question I had is concerning registering proxies. At the moment I have deferred instantiation of mediators, but all proxies are registered at startup, just because I didn't know where else to register them. Am I correct in assuming that they could be registered in a different command? And would it be ok if they are registered in mediators?

Probably these are questions with obvious answers, but I'm having a hard time figuring out what is good practice and what not.

BTW Cliff, congratulations on a magnificent job. I'm really enthousiastic about this framework, even though I don't fully grasp it yet.
5  Announcements and General Discussion / Getting Started / Extended example on: March 14, 2008, 01:54:01
Does anybody know of an extended/advanced example of using pureMVC? I know Actionscript very well, but design patterns and frameworks are pretty new to me and I'm considering using pureMVC for my next client, since it will be a pretty big and complex application. However, I  feel a little insecure about how to structure the whole thing and would really appreciate a large example with pureMVC. It doesn't have to contain all the code, just an application structure would be already very helpful!
Pages: [1]