model view controller - How to use the Facade.Instance method without object construction? -
I recently completed an entity on software patterns and is now trying to understand the PureMVC framework. One thing has got me stumped, which is simple for the gurus here.
I am trying to make an example of the singleton mask class. In the constructor, the comment status:
This is the IFKAd implementation singleton, so you should not call the constructor directly, but rather call the static Singleton Factory method mask.
How can you call the example method when the mask object is not created?
Mask. Instance method looks like this:
public static IFacade example {get (m_instance == null) {lock (m_staticSyncRoot) {if (m_instance = = null) m_instance = new mask (); }} Return m_instance; }}
You are reaching a static property, part of the definition of static properties class Are not class examples To access a stable member (property, area, method), simply use a class name dot member:
var myFacade = SomeClass.Instance;
Comments
Post a Comment