Merge lp:~julien-spautz/cable/authors-hacking-thanks into lp:cable

Proposed by Julien Spautz
Status: Merged
Approved by: Eduard Gotwig
Approved revision: 119
Merged at revision: 118
Proposed branch: lp:~julien-spautz/cable/authors-hacking-thanks
Merge into: lp:cable
Diff against target: 297 lines (+142/-123)
5 files modified
AUTHORS (+5/-0)
HACKING (+121/-0)
README.rst (+0/-121)
THANKS (+10/-0)
src/Cable.vala (+6/-2)
To merge this branch: bzr merge lp:~julien-spautz/cable/authors-hacking-thanks
Reviewer Review Type Date Requested Status
Eduard Gotwig (community) Needs Fixing
Review via email: mp+180967@code.launchpad.net

Description of the change

added AUTHORS and THANKS files
renamed README to HACKING

To post a comment you must log in.
Revision history for this message
Tom Beckmann (tombeckmann) wrote :

My email changed a while ago, it's tomjonabc(at)gmail(dot)com now, did you find it that way somewhere else? Maybe I should fix it there too. Thanks!

Revision history for this message
Julien Spautz (julien-spautz) wrote :

I found it in the src/Cable.vala file. Don't worry, I'll fix it for you.

118. By Julien Spautz

fixed Tom's email

Revision history for this message
Eduard Gotwig (gotwig) wrote :

I would be glad if you could add

https://launchpad.net/~oppifjellet

and

https://launchpad.net/~nkanaev

to the contributors part.

They've done a great job on Cable development and bug fixing!

btw. when can we merge this?

review: Needs Fixing
119. By Julien Spautz

added 2 more contributors

Revision history for this message
Julien Spautz (julien-spautz) wrote :

The branch is ready to be merged now.

> I would be glad if you could add
>
>
> https://launchpad.net/~oppifjellet
>
> and
>
> https://launchpad.net/~nkanaev
>
> to the contributors part.
>
> They've done a great job on Cable development and bug fixing!
>
> btw. when can we merge this?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'AUTHORS'
2--- AUTHORS 1970-01-01 00:00:00 +0000
3+++ AUTHORS 2013-08-21 01:40:39 +0000
4@@ -0,0 +1,5 @@
5+Akshay Shekher <voldyman666@gmail.com>
6+Auroral Xylon <avlabs314@gmail.com>
7+Eduard Gotwig <gotwig@ubuntu.com>
8+Julien Spautz <spautz.julien@gmail.com
9+Tom Beckmann <tomjonabc@gmail.com>
10
11=== added file 'HACKING'
12--- HACKING 1970-01-01 00:00:00 +0000
13+++ HACKING 2013-08-21 01:40:39 +0000
14@@ -0,0 +1,121 @@
15+Developer Documentation
16+=======================
17+
18+This document explains how cable works internally and what guidelines you should follow when developing for it.
19+
20+Design Pattern
21+==============
22+
23+The current design pattern could be called "Passive View", see http://martinfowler.com/eaaDev/PassiveScreen.html.
24+
25+The View
26+--------
27+
28+The View is a software layer that acts as an interface between the program and the user. The View can be acted upon by the user and notify the application of these events (using signals). But its state can also be changed by the application to present some content to the user or request input from the user.
29+
30+In the ``src/View`` folder you will find interfaces that the Controller uses to communicate with the View. The actual implementation can be found in the ``src/Widgets`` folder. This separation bears the advantage that we can change the implementation of the View completely as long as we implement the interfaces. This makes the application independant of the GUI, and we could replace it by a text-based UI or even by a computer simulated UI to run unit tests.
31+
32+Nota bene: The View does not know about any other module (except possibly ``src/Utils`` which contains functions accessible to everyone)
33+
34+The Model/Backend
35+-----------------
36+
37+The traditional name 'Model' doesn't really fit Cable's architecture, as it is based on an interactive networking protocol (namely the IRC protocol) and not on a set of data or even a database. The following modules form the backend of the app and are more or less independant of each other.
38+
39+**Irc**
40+
41+The Irc namespace contains wrapper classes that provide convenient methods, properties and signals that map to dbus calls to the maki IRC daemon. Following naming conventions have been used:
42+
43+ - All signals are prefixed with ``event_``
44+ - All methods that send commands to the server are prefixed with ``send_``
45+ - Most methods that yield an immediate return value are properties, if it makes sense
46+
47+Examples:
48+
49+ ``public void send_join (string key = "");``
50+
51+ ``public void event_join (string from);``
52+
53+ ``public bool joined { get; }``
54+
55+**Settings**
56+
57+The Settings namespace contains convenient interfaces to the dconf/gsettings using Granite.Services.Settings.
58+
59+**Services**
60+
61+The Services should (whenever possible) be static classes. Currently there is a ``Launcher`` class as interface to libunity and a ``Notification`` class as interface to libnotify. They should have an extremely simple API and contain only functions that are actually used in the app. For example, here you see the ``Cable.Services.Launcher`` API:
62+
63+ ``public static int64 jobs { get; set }``
64+
65+ ``public static double progress { get; set }``
66+
67+ ``public static bool urgent { get; set }``
68+
69+ ``public static void init ();``
70+
71+**Utils**
72+
73+This namespace contains some useful functions and classes that are used in multiple places in the app. The Network and Identity classes, for example, store all networks and identities in a convenient way and make sure no duplicates will be created.
74+
75+The Controller
76+--------------
77+
78+The controller is the brain of the app in the sense that it connects different classes that don't know about each other and contains most of the program logic. Conversely, no one knows about the Controller, which means no one can actively act upon the Controller. To communicate with other parts of the application, the Controller connects to their public signals, or uses their public methods and properties.
79+
80+********************************************************************************
81+
82+Tiers
83+=====
84+
85+Now that you know about the separation of concerns implemented by the Passive View pattern, I want to explain a recurring pattern in the app which can be broken up into 3 (or 4) tiers, a tree-like hierarchial structure. It looks like this:
86+
87+ Application Tier (one instance)
88+
89+ ↓ (n)
90+
91+ Window Tier (n windows per application, unless artificially restricted)
92+
93+ ↓ (n)
94+
95+ Server Tier (n server connections can be established per window)
96+
97+ ↓ (n)
98+
99+ Channel Tier (n channels per server)
100+
101+This means that the app owns multiple windows, each window has a list of servers, which in turn own any number of channels. This structure exists in many places in the program, which is why it is worth noticing. Obviously it exists in the View/Widgets layer, but also the controller is split into multiple classes, to get cleaner code.
102+
103+In order to make communication between different parts of the application as clean and abstract as possible, it shall *only* occur via these tiers. That is you should not (and cannot) access, any widgets from the Controller, as all communication has to happen via ``View.Window``, ``View.Server`` or ``View.Channel``.
104+
105+So instead of calling something like this from the controller:
106+
107+ ``channel_view.room.topic.text = new_topic;``
108+
109+you would use:
110+
111+ ``channel_view.topic = new_topic;``
112+
113+and the channel widget will take care of the forwarding.
114+
115+********************************************************************************
116+
117+Unit Testing
118+============
119+
120+Unit Testing, Test Driven Development, Extreme Programming… What can we learn from these techniques?
121+
122+GLib provides a very basic way to implement unit tests, and libgee built their TestCase class on it. It allows for simple unit tests, nothing fancy but really straight forward. The main question is where does it make sense to apply unit tests and how do we implement them in a sensible way.
123+
124+Most (virtually all) of the logic lies in the Controller module, as intended. This allows us to bypass the View and replace it by a fake View that implements the same interface but is controlled by the programm. In the same way, we can replace the backend and imitate it's interface to provide a fake backend and simulate really weird server bugs that only happen very rarely and can therefore not be reproduced reliably in a real world environement.
125+
126+Functions and classes in the Utils namespace can also easily be unit tested as they are not connected with the rest of the program. An example would be the URL parsing function.
127+
128+Note that none of this has been implemented (except to a very simple test which can be run using the ``--unit-test`` CLI switch, just as a proof of concept).
129+
130+********************************************************************************
131+
132+Questions?
133+==========
134+
135+If you have any questions relating to the architecture of the app, shoot me an email at <spautz.julien@gmail.com> or ask me on IRC (#elementary-dev or #elementary-apps on irc.freenode.net). My nick is julienspautz.
136\ No newline at end of file
137
138=== removed file 'README.rst'
139--- README.rst 2013-08-06 15:32:12 +0000
140+++ README.rst 1970-01-01 00:00:00 +0000
141@@ -1,121 +0,0 @@
142-Developer Documentation
143-=======================
144-
145-This document explains how cable works internally and what guidelines you should follow when developing for it.
146-
147-Design Pattern
148-==============
149-
150-The current design pattern could be called "Passive View", see http://martinfowler.com/eaaDev/PassiveScreen.html.
151-
152-The View
153---------
154-
155-The View is a software layer that acts as an interface between the program and the user. The View can be acted upon by the user and notify the application of these events (using signals). But its state can also be changed by the application to present some content to the user or request input from the user.
156-
157-In the ``src/View`` folder you will find interfaces that the Controller uses to communicate with the View. The actual implementation can be found in the ``src/Widgets`` folder. This separation bears the advantage that we can change the implementation of the View completely as long as we implement the interfaces. This makes the application independant of the GUI, and we could replace it by a text-based UI or even by a computer simulated UI to run unit tests.
158-
159-Nota bene: The View does not know about any other module (except possibly ``src/Utils`` which contains functions accessible to everyone)
160-
161-The Model/Backend
162------------------
163-
164-The traditional name 'Model' doesn't really fit Cable's architecture, as it is based on an interactive networking protocol (namely the IRC protocol) and not on a set of data or even a database. The following modules form the backend of the app and are more or less independant of each other.
165-
166-**Irc**
167-
168-The Irc namespace contains wrapper classes that provide convenient methods, properties and signals that map to dbus calls to the maki IRC daemon. Following naming conventions have been used:
169-
170- - All signals are prefixed with ``event_``
171- - All methods that send commands to the server are prefixed with ``send_``
172- - Most methods that yield an immediate return value are properties, if it makes sense
173-
174-Examples:
175-
176- ``public void send_join (string key = "");``
177-
178- ``public void event_join (string from);``
179-
180- ``public bool joined { get; }``
181-
182-**Settings**
183-
184-The Settings namespace contains convenient interfaces to the dconf/gsettings using Granite.Services.Settings.
185-
186-**Services**
187-
188-The Services should (whenever possible) be static classes. Currently there is a ``Launcher`` class as interface to libunity and a ``Notification`` class as interface to libnotify. They should have an extremely simple API and contain only functions that are actually used in the app. For example, here you see the ``Cable.Services.Launcher`` API:
189-
190- ``public static int64 jobs { get; set }``
191-
192- ``public static double progress { get; set }``
193-
194- ``public static bool urgent { get; set }``
195-
196- ``public static void init ();``
197-
198-**Utils**
199-
200-This namespace contains some useful functions and classes that are used in multiple places in the app. The Network and Identity classes, for example, store all networks and identities in a convenient way and make sure no duplicates will be created.
201-
202-The Controller
203---------------
204-
205-The controller is the brain of the app in the sense that it connects different classes that don't know about each other and contains most of the program logic. Conversely, no one knows about the Controller, which means no one can actively act upon the Controller. To communicate with other parts of the application, the Controller connects to their public signals, or uses their public methods and properties.
206-
207-********************************************************************************
208-
209-Tiers
210-=====
211-
212-Now that you know about the separation of concerns implemented by the Passive View pattern, I want to explain a recurring pattern in the app which can be broken up into 3 (or 4) tiers, a tree-like hierarchial structure. It looks like this:
213-
214- Application Tier (one instance)
215-
216- ↓ (n)
217-
218- Window Tier (n windows per application, unless artificially restricted)
219-
220- ↓ (n)
221-
222- Server Tier (n server connections can be established per window)
223-
224- ↓ (n)
225-
226- Channel Tier (n channels per server)
227-
228-This means that the app owns multiple windows, each window has a list of servers, which in turn own any number of channels. This structure exists in many places in the program, which is why it is worth noticing. Obviously it exists in the View/Widgets layer, but also the controller is split into multiple classes, to get cleaner code.
229-
230-In order to make communication between different parts of the application as clean and abstract as possible, it shall *only* occur via these tiers. That is you should not (and cannot) access, any widgets from the Controller, as all communication has to happen via ``View.Window``, ``View.Server`` or ``View.Channel``.
231-
232-So instead of calling something like this from the controller:
233-
234- ``channel_view.room.topic.text = new_topic;``
235-
236-you would use:
237-
238- ``channel_view.topic = new_topic;``
239-
240-and the channel widget will take care of the forwarding.
241-
242-********************************************************************************
243-
244-Unit Testing
245-============
246-
247-Unit Testing, Test Driven Development, Extreme Programming… What can we learn from these techniques?
248-
249-GLib provides a very basic way to implement unit tests, and libgee built their TestCase class on it. It allows for simple unit tests, nothing fancy but really straight forward. The main question is where does it make sense to apply unit tests and how do we implement them in a sensible way.
250-
251-Most (virtually all) of the logic lies in the Controller module, as intended. This allows us to bypass the View and replace it by a fake View that implements the same interface but is controlled by the programm. In the same way, we can replace the backend and imitate it's interface to provide a fake backend and simulate really weird server bugs that only happen very rarely and can therefore not be reproduced reliably in a real world environement.
252-
253-Functions and classes in the Utils namespace can also easily be unit tested as they are not connected with the rest of the program. An example would be the URL parsing function.
254-
255-Note that none of this has been implemented (except to a very simple test which can be run using the ``--unit-test`` CLI switch, just as a proof of concept).
256-
257-********************************************************************************
258-
259-Questions?
260-==========
261-
262-If you have any questions relating to the architecture of the app, shoot me an email at <spautz.julien@gmail.com> or ask me on IRC (#elementary-dev or #elementary-apps on irc.freenode.net). My nick is julienspautz.
263\ No newline at end of file
264
265=== added file 'THANKS'
266--- THANKS 1970-01-01 00:00:00 +0000
267+++ THANKS 2013-08-21 01:40:39 +0000
268@@ -0,0 +1,10 @@
269+The Cable team would like to thank the following code contributors:
270+
271+Alexander Wilms <alexander.wilms@zoho.com>
272+Corentin Noël
273+Daniele Simonetti
274+Evan Banyash <ebanyash@gmail.com>
275+Kristjan Vool <tictac7x@gmail.com>
276+Mario Guerriero
277+nkanaev <nkanaev@live.com>
278+Paulo Galardi
279
280=== modified file 'src/Cable.vala'
281--- src/Cable.vala 2013-08-06 15:32:12 +0000
282+++ src/Cable.vala 2013-08-21 01:40:39 +0000
283@@ -66,8 +66,12 @@
284 help_url = "https://answers.launchpad.net/cable";
285 translate_url = "https://translations.launchpad.net/cable";
286
287- about_authors = {"Akshay Shekher <voldyman666@gmail.com", "Auroral Xylon <avlabs314@gmail.com>", "Eduard Gotwig <gotwig@ubuntu.com>", "Julien Spautz <spautz.julien@gmail.com", "Tom Beckmann <tombeckmann@online.de>"};
288- about_documenters = {"Tom Beckmann <tombeckmann@online.de>"};
289+ about_authors = {"Akshay Shekher <voldyman666@gmail.com>",
290+ "Auroral Xylon <avlabs314@gmail.com>",
291+ "Eduard Gotwig <gotwig@ubuntu.com>",
292+ "Julien Spautz <spautz.julien@gmail.com>",
293+ "Tom Beckmann <tomjonabc@gmail.com>"};
294+ about_documenters = {};
295 about_artists = {"Harvey Cabaguio <harveycabaguio@gmail.com"};
296 about_comments = _("Development release, not all features implemented");
297 about_translators = "Launchpad Translators";

Subscribers

People subscribed via source and target branches

to all changes: