I only recently completed a unit on software patterns and am now attempting to comprehend the PureMVC framework. One thing has got my stumped however, something which is simple to the gurus here.
I'm attempting to create an instance of the singleton Facade class. In the constructor, the comments state:
This IFacade implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton Factory method Facade.Instance
How can you call the instance method when the Facade object has not even been created?
The Facade.Instance method looks like this:
public static IFacade Instance
{
get
{
if (m_instance == null)
{
lock (m_staticSyncRoot)
{
if (m_instance == null) m_instance = new Facade();
}
}
return m_instance;
}
}