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 / General Discussion / Re: newbie question--scope of facade? on: September 14, 2008, 11:48:49
No, actually I think you're absolutely right Cliff. I mean, I have no problem with all of my implementation being littered with repitious beauty like:

(facade.retrieveProxy( StartupMonitorProxy.NAME ) as StartupMonitorProxy).addResource()
(facade.retrieveProxy( ConfigProxy.NAME ) as ConfigProxy).getParameter( paramName )

All of that inline casting indicates that the design is congruent with the actual use, rather than just with a concept. And you are right, it does prevent all of those wrapper-accessors from gumming up your facade. I just can't think of a better way to do it. Could you?

k,thx.
2  Announcements and General Discussion / General Discussion / Re: newbie question--scope of facade? on: September 13, 2008, 01:23:31
Well, then how would you organize these kinds of wrappers? These are naturally mixed into a pMVC-global context. Facade seems a natural place to hang them rather than a proliferation of static utility classes.

I'm not understanding what you're saying about commands being sufficient. SimpleCommand also extends Notifier, so we would have the same situation trying to add global scope utility methods to SimpleCommand.

Granted I'm just trying to address code legibility and brevity for common phrases, not architectural patterns. But those are dual aspects of design. Without a macro (#define...) type of facility, how do you avoid all the inline casting?

3  Announcements and General Discussion / General Discussion / Re: newbie question--scope of facade? on: September 11, 2008, 06:31:17
Oh, geeze, at the moment just things like caching access to proxies, notification-based logging wrapper, etc. Common one liners. Things like:

facade.startupMonitor.addResource()
facade.logger.info( componentName, notification )
facade.getParameter( paramName )  etc.

instead of:

(facade.retrieveProxy( StartupMonitorProxy.NAME ) as StartupMonitorProxy).addResource()
Logger.getLogger( name ).info( name + ": " + note.getName() + ": " + note.getBody() )
(facade.retrieveProxy( ConfigProxy.NAME ) as ConfigProxy).getParameter( paramName )

Again from the school of less is more OOD. I suppose we could have a parallel pMVC utility static singleton, but facade is already if we could extend it cleanly.

Thx,
k.
4  Announcements and General Discussion / General Discussion / Re: newbie question--scope of facade? on: September 11, 2008, 02:52:11
Ah, thanks, why didn't I see that (and my regexp search for facade\s*: didn't find it either.) My bad.

Well, we are resorting to MyAppFacade.getInstance()... but I'm from the wudang school of emptiness, so even that is rather bulky for my style. I suppose we could create a layer of subclasses, MyProxy, MySimpleCommand etc., yuck, or simply expose MyApp.facade as a public static variable or accessor. It would be nice to be able to extend Facade in a non-app-specific way without modifying the base sources.

If not through subclassing Facade, how would you suggest mixing in a global set of pMVC-related utility methods to the scope of commands, mediators, proxies, and views generally?

Thx,
k.
5  Announcements and General Discussion / General Discussion / newbie question--scope of facade? on: September 11, 2008, 12:52:29
Getting started with PureMVC/AS3 and confused about the scope and declaration of facade. Where is there a global instance named facade declared?  Couldn't find it in PureMVC.

Specifically I would like to add utility methods to the concrete app-specific subclass of Facade and have the facade instance (global scope? package scope?) be of type MyAppFacade rather than the base Facade.

I see the static instance: Facade declaration in Facade.as, and that makes sense. But I don't see any global/static declaration of facade: Facade. How is everything able to refer to facade.registerProxy(...) etc? Don't tell me it's all one giant closure?!

Thanks,
k.
Pages: [1]