diff options
Diffstat (limited to 'docs/design.md')
-rw-r--r-- | docs/design.md | 94 |
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 | ||
4 | Kontact Quick is supposed to be a small and concise codebase that is easy to modify and evolve. | ||
5 | |||
6 | It'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 | |||
8 | The 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 | |||
24 | The 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 | |||
26 | The 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 | |||
28 | The 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, ...) | ||
33 | Various bits of the infrastructure layer may be exchanged on different platforms, to i.e. integrate into native infrastructure providers on a platform. | ||
34 | |||
35 | Note: By using the onion architecture we ensure the infrastructure is exchangable just as well as the UI. | ||
36 | |||
37 | ## Domain Logic | ||
38 | |||
39 | ### Models | ||
40 | Self-updating models are used to implement the read-only part of the application. | ||
41 | By 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 | |||
43 | Models should always be reactive and configured with a query, so they are asynchronous. | ||
44 | |||
45 | By 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 | ||
48 | Use-case specific controllers are used to operate on the data. Controllers allow to completely separate the modifications from the view. | ||
49 | Rather 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. | ||
50 | Of course controllers will need to share functionality internally as soon as an action is available from more than one place. | ||
51 | |||
52 | ## Infrastructure | ||
53 | |||
54 | The 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 | ||
57 | Akonadi Next is used for primary data access and handles all synchronization. | ||
58 | |||
59 | ### Configuration | ||
60 | Configuration as traditionally store in config files in ~/.kde | ||
61 | |||
62 | ### Notification | ||
63 | Notifications for the system. | ||
64 | |||
65 | ### Files | ||
66 | Store/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 | ||
71 | Same 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 | |||
82 | Keyselection, encryption, decryption, signing | ||
83 | Probably requires access to identities in some way. | ||
84 | |||
85 | ### MIME-Message parsing | ||
86 | * ObjectTreeParser | ||
87 | * KMime | ||
88 | |||
89 | ## Interaction with external applications | ||
90 | External 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 | |||
92 | The same mechanism should probably be used by Kontact Quick itself to ensure loose coupling and allow mashups with various content types. | ||
93 | |||
94 | Note: We'll probably want a component-viewer application to easily load and test individual components (similar to plasmoidviewer). | ||