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

Pages: [1]
Print
Author Topic: Notifier extensibility  (Read 7828 times)
dmurat
Courseware Beta
Newbie
***
Posts: 2


View Profile Email
« on: June 04, 2008, 03:07:39 »

I was wondering if Notifier class can be redefined a little. Currently, it has "facade" member initialized with "Facade.getInstance()". If one wants to use different IFacade implementation in Notifier subclasses, it is impossible. Therefore, if I may suggest, I believe Notifier can be made more extensible by using setter and getter (or just getter) instead of instance variable. Then, it will become possible to override it in subclasses.

I think this is already implemented that way in multicore version.

Best regards,
Damir Murat
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: June 04, 2008, 03:18:32 »

It is reimplemented in MultiCore, but at the expense of having to wait until initializeNotifier before any facade related activity can happen. It had to be done that way in MultiCore because there is more than one Facade instance, and you don't know the multiton instance to ask for until the multiton key is set.

The Facade.getInstance() call in the Notifier class does not get an instance of Facade, it gets whatever IFacade implementor that extends Facade that you have created. The assumption is that you have already initialized your ApplicationFacade by the time you are creating your Notifiers.

-=Cliff>
Logged
dmurat
Courseware Beta
Newbie
***
Posts: 2


View Profile Email
« Reply #2 on: June 04, 2008, 04:26:07 »

Tnx for such quick reply.

Well, the problem is that I will like to use method with different signature and from class which doesn't extends Facade, but rather just implement IFacade. On the other hand, I will like to use Notifier implementation. Heh, I guess I'm a little bit demanding :-)

But never mind, It is not so big issue for me. I was just thinking that introduction of getter will easily solve my needs without breaking anything.

Best regards,
Damir Murat
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: June 04, 2008, 10:26:13 »

It's tempting to add getters a getter or some such to the facade, but then it could quickly become the trash heap of your app. That's one of the reasons people rail against the use of Singletons, because of the kind of fallout that comes from 'Global' thinking.

What kind of getter were you wanting to put on there? It could probably be better placed elsewhere.

-=Cliff>
Logged
Pages: [1]
Print