Skip to main content
Participant
September 8, 2008
Question

Reseting the model

  • September 8, 2008
  • 2 replies
  • 672 views
Whats the best way to reset the model singletons (and also the whole app if possible) when the user logs out?

Thanks

Craig
This topic has been closed for replies.

2 replies

Participating Frequently
September 24, 2008
Craig,
Again, this is probably a bit off topic since it's not directly related to the future of cairngorm. However, this is, I think, a cairngorm implementation question that may be worth talking about here, since it's related to the highly misunderstood Model layer of the framework.

First, I think you should think about your ModelLocator as a way to access your application Model(s), not the Model itself. Having seperate business and presentation models, you may encapsulate your own initialization logic which can then be invoked regardless of your ModelLocator implementation.

In your example, you can have a LogOutCommand which invokes the concerned model(s) and call the initialization methods, or simply reinstantiate it.
Inspiring
September 8, 2008
navigateToUrl( new UrlRequest('/') );//or where ever your app lives