blob: 764780e3d7fb7e51fe95f41db0abe094284d414f [file] [log] [blame] [view]
[Melange](MelangeIntro.md) follows
[Model-View-Controller](http://en.wikipedia.org/wiki/Model-view-controller) patterns
at multiple levels. The [SoC framework](SoCOverview.md) provides a set of
common [Model](ModelsOverview.md), [Views](ViewsOverview.md), and
[generic Controllers](ControllersOverview.md) to be used by each Melange
web application. Each of those applications is then similarly arranged
in a Model-View-Controller pattern.
## Models
Entities of each [Model](ModelsOverview.md) are stored in the
[Google App Engine Datastore](http://code.google.com/appengine/docs/datastore/). All
data for a given instance of a particular Program is stored in Model entities
in the Datastore. The SoC framework Models are designed so that they can be
used in a variety of Program formats, including both [GSoC](GSoC.md) and
[GHOP](GHOP.md). Other Melange Models not in the SoC framework are specific to
a particular Program.
The Models are also designed so that, while entities are specific to a given
year of a particular Program, entities can be _imported_ from one Program
instance to another. For example, a [Person](PersonModel.md) need not re-enter
all of their personal information to participate in another, future Program,
even if their participation is going to be in a different role (an
[Organization](OrganizationModel.md) [Reviewer](ReviewerModel.md), say, rather than
a [Contributor](ContributorModel.md)).
## Views
Model entities are displayed and modified via a variety of
[Views](ViewsOverview.md). Some views simply display entities or lists of
entities, while other views are forms for creating and altering entities.
The Melange views are implemented using Django templates and forms.
Many of these views are shared and re-used between different Programs and
their Program-specific [Controllers](ControllersOverview.md).
### Import and Export Views
In addition to the HTML page views, other special "Views" are used to provide
read-write [GData APIs](GDataOverview.md) and read-only [Atom feeds](FeedsOverview.md)
and CSV file exports. These GData APIs, Atom feeds, and CSV files provide
import and export capabilities for Program entities.
The Melange GData APIs will also make it possible to implement alternative
front-ends capable of viewing and manipulating, say, one Organization's data.
Such a front-end could be implemented in any programming language that can be
used to implement a GData client. Such Organization-specific front-ends could,
for example, be embedded in the Organization's web site. These GData APIs
could also be used to create widgets such as
[Google Gadgets](http://code.google.com/apis/gadgets/) that monitor or alter small
aspects of a Program.
Atom feeds make it possible to monitor activity during the course of a
Program **without** resorting to email, using a _pull_ approach instead of the
existing email _push_ method.
## Controllers
Each separate program (e.g. [GSoC](GSoC.md) and [GHOP](GHOP.md)) implements its own
[Controller](ControllersOverview.md) containing the "business logic" of the
program (though in the case of these two examples, much of the code in the
two Controllers is expected to be shared). It will be possible to support
Program formats that have not yet been conceived by adding new Controller
modules to the framework. Since Melange is being released under an Open Source
license, new Sponsor organizations could implement their own custom Program
while reusing much of the SoC framework code.
### Security and Roles
The Controllers make use of [user role](UserRoles.md) [Model entities](RoleModels.md)
to decide what other Program entities are viewable or modifiable by a
particular
[Google Accounts-authenticated](http://www.google.com/support/accounts/)
[User](UserModel.md).
[Views](ViewsOverview.md) will submit the Model entity and the
[specific role](UserRoles.md) to an "authorization" method in the Controller.
This method will indicate what privileges (read-only, read-write,
not-authorized, etc.) that specific User in that specific Role has for
that specific Model entity. These authorization methods in the Controller
can also provide error indications and descriptive text that can be
displayed to the User by the View.
---
_Copyright 2008 Google Inc._
_This work is licensed under a_
[Creative Commons Attribution 2.5 License](http://soc.googlecode.com/svn/wiki/html/licenses/cc-by-attribution-2_5.html).
[![](http://soc.googlecode.com/svn/wiki/html/licenses/cc-by-2_5-88x31.png)](http://creativecommons.org/licenses/by/2.5/)