What are the best practices for implementing models in the MVC pattern. Specifically, if I have ‘Users’ do I need to implement 2 classes. One to manage all the users and one to manage a single user. So something like ‘Users’ and ‘User’?
I’m writing a Zend Framework app in php but this is more a general question.
The model should be driven by the needs of the problem. So if you need to handle multiple users, then a class representing a collection of Users might be appropriate, yes. However, if you don’t need it, don’t write it! You may find that a simple array of User objects is sufficient for your purposes.