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: Facade.getInstance needs to return IFacade  (Read 4783 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: February 28, 2010, 04:14:34 »

Currently it returns a Facade. This keeps you from being able to do:

:
/**
* get the instance.
* @return the singleton
*/
public static HelloWorldFacade getInstance( String key ) {
if (instance == null) {
instance = new HelloWorldFacade( key );
}
return instance;
}

...as you should in your concrete Facade subclass.

This why was it implemented to return the class instead of the interface? Are there other places where the AS3 reference methods return an interface but you return instead a class? It might be a good time to investigate when you make this change.

-=Cliff>
Logged
Pages: [1]
Print