New Site Architecture
This page explains the architectural principles behind the GCD's new web site implementation. The goal is to make it clear to anyone participating in the project how the pieces fit together, where new code should be added for any given purpose, and how to find existing code in the tree.
The GCD will adhere to the following major architectural principles for the new site:
- Application code will be organized along Model/View/Controller (MVC) lines, as facilitated by Django.
- GCD data will be viewable in some clear and reasonable form on all browsers.
- Models must have no awareness of controllers (Django views) or views (Django templates).
- Models must be unaware of URLs.
- Methods should be added to models only when they represent an attribute of the object that the model represents. For instance, a value that is calculated from multiple database columns, or one that might be read in different ways depending on settings (a cached count vs. executing a count on a related data set).
Controller (Django Views)
View (Django Templates)
- HTML will be purely structural in nature. No inline style attributes or style markup.
- HTML should be clear and readable with styles disabled or limited (such as on a mobile device or text browser).
- Links should always result in a page most closely associated with the linking object. To clarify: a link through a series name should always land on some sort of series page, while an issue link should always land on some sort of issue page. The series or issue page may pull in additional information from other objects in some circumstances, but the primary presentation should reflect the object that the user clicked on.
- Fields should not be overloaded. By "field" we mean any box, list item, paragraph, etc. used to hold specific data. Each such field should hold one or at most a small number of closely related items. Not a larger set run together in a sentence or separated only by punctuation.