6. Modeling

The idea about models in an MVC framework is that it's supppose to define every available method regarding that model. The limitations of an actual model is that it only defines functionality for one object. This is why we object to say that a model is a component of a module. A module can (as opposed to required) have the following components.

  • Model - Defines an object relational map (ORM) to a data store usually, a database or a service.
  • Search - Used to query a data store or service
  • Collection - Defines functionality for a set of models
  • Blocks - a set of output blocks generically defined.
  • Event Handler - a set of generic responses to specific events.
  • Factory Class - Used to easily access module components and can also contain utility methods.

In this section we will go over all of the above components using a post model as an example.


© 2012 Openovate Labs. All rights reserved.