Instantiating and referencing models in MVC

Posted by fig-gnuton on Stack Overflow See other posts from Stack Overflow or by fig-gnuton
Published on 2010-06-16T13:30:10Z Indexed on 2010/06/16 13:32 UTC
Read the original article Hit count: 191

Filed under:
|
|
|

In MVC, should each model be a globally accessible singleton accessible to any view/controller?

Or should the models be singletons that are dependency injected into any component that requires them?

Or should a new model instance be created for each component that needs one, in which case events would be used to propagate changes across model instances of the same class?

© Stack Overflow or respective owner

Related posts about mvc

Related posts about design-patterns