-1

Most of the answers I see that discuss what the model layer is comprised of, only address stateless MVC, particularly ASP.NET's implementation of it. When working with desktop MVC frameworks such as Cocoa, is application state considered as part of the "Model" layer?

2
  • 2
    I don't think this question can be meaningfully answerable in its present form. Fundamentally, state is just some data held in transition, and it can appear in many different places in an application. If you want to know where that state is held in Cocoa, study Cocoa. Jan 15, 2021 at 15:06
  • But in general, the model layer can be stateful, if that's what you're asking - it's an orthogonal concern. Jan 16, 2021 at 12:23

1 Answer 1

0

Yes, the Model is where state visible to the user is traditionally stored. As others have stated, there are different types of state: a view state for example, affects only the view, and would not be part of the Model. Even in a "stateless" MVC, there is going to be some persistent state somewhere, and that is considered part of the Model, even if the Model is thrown out and reconstituted on each request.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.