MVC in Ferris
Ferris is similar to a lot of other MVC frameworks, though the terminology is slightly different:
- Models handle the retrieval and storage of data in the App Engine Datastore. Models are simply Google App Engine ndb.Model subclasses with a few helper methods. Typically a most of the business logic is implemented in the model layer.
- Handlers are responsible for responding to HTTP requests. Handlers are typically thin glue between models and templates. Handlers have special methods called actions that are accessable via HTTP.
- Templates handle the presentation of data to the user. Templates have access to data from that’s retrived by the handlers. Ferris uses the jinja2 template engine.
- Routing Maps urls to handler actions. This happens more or less automatically, but you can define custom routes and redirects.
- Scaffolding can automatically create CRUD (create, read, update, delete) actions and templates for you, and can be customized and augmeneted to fit your needs.
- Forms are ways of representing data submitted by a client that’s used to update a model.
- Components are a way of packaging common handler behavior into reusable classes.
- Plugins are a way of packaging entire parts of an application to be reused in another.