Skip to content
dgranda edited this page Aug 27, 2012 · 1 revision

The current archetecture conceptually consists of three layers: GUI, core and persistence (see diagram, layer dependencies are adjacent to a layer's bottom edges). The core and GUI layers depend on each other and they both depend directly on the persistence layer. Because of this tight coupling they are effectively a single layer. The persistence layer is a primitive generic SQL abstraction and has no domain knowledge.

Current architecture

This architecture is adequate for very small applications but Pytrainer has out-grown it and needs to be restructured.

Future Architecture

The proposed alternative is a five-layered archetecture that is broadly divided into two main areas: "Core" and "UI" (see diagram, layer dependencies are adjacent to a layer's bottom edges).

Future architecture

The core contains a domain model which maps to the database schema; a persistence layer for storing and retrieving instances of the domain model; and a service layer that higher layers use to access the domain model and perform other actions related to the domain model. The persistence layer will have full domain knowledge and will use a third-party generic SQL abstraction.

The UI contains a data model layer which extends the domain model and provides events, and the GUI itself which is simply made up of widgets and event handling.

Layers in this architecture will always have one-way dependencies.

In addition to the layers described here there will be others such as utility code and data migration code. Extension points and plugins should fit in to the Data Model and GUI layers.

Clone this wiki locally