summaryrefslogtreecommitdiffstats
path: root/docs/design.md
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-09 10:21:58 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-09 10:21:58 +0200
commit055ca386419b6f10bce60232c2a425c2931da6ed (patch)
tree9869305ccedaba66b687635d1b71d7ae1546a4fa /docs/design.md
parent4fa375062d6ba14947923c01bffbf06ce91325bf (diff)
downloadkube-055ca386419b6f10bce60232c2a425c2931da6ed.tar.gz
kube-055ca386419b6f10bce60232c2a425c2931da6ed.zip
Added documentation
Diffstat (limited to 'docs/design.md')
-rw-r--r--docs/design.md94
1 files changed, 94 insertions, 0 deletions
diff --git a/docs/design.md b/docs/design.md
new file mode 100644
index 00000000..2e2b6997
--- /dev/null
+++ b/docs/design.md
@@ -0,0 +1,94 @@
1# Architecture / Design
2
3## Overview
4Kontact Quick is supposed to be a small and concise codebase that is easy to modify and evolve.
5
6It's following a reactive model, where in one direction we have controllers generating modifications, and in the other direction models updating themselves on changes.
7
8The overall architecture is split into three layers; Ui, Domain Logic and Infrastructure.
9
10```
11+----------------------------+
12| UI |
13+----------------------------+
14| |
15| Domain Logic |
16| |
17+--------------+------+------+
18| | | |
19| Akonadi Next |Config| ... |
20| | | |
21+--------------+------+------+
22```
23
24The UI Layer consists of views (mostly written in QML), view-models (models that are view specific and potentially implement user interaction details), and the glue code to use various controllers from the interface. Different UI layers may exist for different form factors.
25
26The domain logic layer holds the application state. It povides models to access data and controllers to act upon it. The domain logic is by definition Kontact Quick specific and not sharable with other applications, at it needs to be taylored exactly according to the requirements of Kontact Quick.
27
28The infrastructure layer provides:
29
30* Data access (Akonadi Next)
31* Configuration (Config files, etc.)
32* Various functionality provided by libraries (email sending, ldap, iTip handling, iCal implementation (kcalcore), vCard implementation, ...)
33Various bits of the infrastructure layer may be exchanged on different platforms, to i.e. integrate into native infrastructure providers on a platform.
34
35Note: By using the onion architecture we ensure the infrastructure is exchangable just as well as the UI.
36
37## Domain Logic
38
39### Models
40Self-updating models are used to implement the read-only part of the application.
41By using QAbstractItemModels we can reuse the existing update mechanism, have something that works well with QML, and avoid implementing a boatload of boilerplate code for hand-coded domain objects.
42
43Models should always be reactive and configured with a query, so they are asynchronous.
44
45By implementing everything according to that model we can later on achieve lazy-loading of properties and zero-copy (or at least close to zero-copy) directly from storage without modifying anything besides data access.
46
47### Controllers
48Use-case specific controllers are used to operate on the data. Controllers allow to completely separate the modifications from the view.
49Rather than splitting controllers by domain type (e.g. an email controller, or a calendar controller), we specifically write controllers for specific usecases (e.g. an email editor), that exposes all required actions. That way we ensure that the API's a UI is working with is always clear an consice, and that we have all domain logic captured in the domain logic layer, rather than the UI layer.
50Of course controllers will need to share functionality internally as soon as an action is available from more than one place.
51
52## Infrastructure
53
54The infrastructure layer interfaces with the rest of the system. It is the place where we can integrate with various native infrastructure parts.
55
56### Akonadi Next
57Akonadi Next is used for primary data access and handles all synchronization.
58
59### Configuration
60Configuration as traditionally store in config files in ~/.kde
61
62### Notification
63Notifications for the system.
64
65### Files
66Store/Load/Shared stuff (attachments, events, ....)
67* Additional to the basic store/load stuff that may need further abstraction for mobile platforms beyond what qt provides.
68* Android Intents/Libpurpose (share with various applications etc).
69
70### Import/Export
71Same as files? Import/Export calendar data
72
73### RFC implementations
74* iCal: KCalCore
75* vCard: KContacts
76* iTip: extract from kdepim repo
77
78### Cryptography
79* PGP, PEP
80* ObjectTreeParser
81
82Keyselection, encryption, decryption, signing
83Probably requires access to identities in some way.
84
85### MIME-Message parsing
86* ObjectTreeParser
87* KMime
88
89## Interaction with external applications
90External applications, like the KDE calendar plasmoid, should be able to load parts of Kontact Quick when available. It should for instance be possible to load the Event editor as embeddable QML component, that is fully functional. That way it becomes very easy for third parties to provide extra functionality if Kontact Quick is installed, without having to reimplement the Domain Logic (as is the case if only data access is provided through akonadi).
91
92The same mechanism should probably be used by Kontact Quick itself to ensure loose coupling and allow mashups with various content types.
93
94Note: We'll probably want a component-viewer application to easily load and test individual components (similar to plasmoidviewer).