In a traditional MVC application, which component (model, view, or controller) is responsible for reading/writing the model to/from disk?
In a traditional MVC application, which component (model, view, or controller) is responsible for
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer: model layer.
Most of the forms of storage are part of model layer (with exception of templates and autoloader for class). In a fully realized mode layer you would have a group of objects which are directly interacting with low level storage (SQL, cache, REST API, noSQL, file system, etc. ) abstractions.
If you application is actively reading and writing to the filesystem (it could be actually mounted remote MemoryFS, which you mounted via Fuse through SSH tunnel .. it does not matter), this would be handled by structures, which deal with storage logic. Usually some form of data mapper (thought it also might be repositories, units of work, DAOs and/or some similar structures).
The storage abstraction are usually responsible for storing data from and retrieving data into the domain objects. In a large scale application this interaction between domain objects and storage logic structures is contained within services to isolate the application and domain business logic from leaking in the presentation layer.