Improves the documentation
[src/app-framework-binder.git] / doc / afb-overview.html
1 <html>
2 <head>
3   <link rel="stylesheet" type="text/css" href="doc.css">
4   <meta charset="UTF-8">
5 </head>
6 <body>
7 <a name="Overview.of.AFB-DAEMON"></a>
8 <h1>Overview of AFB-DAEMON</h1>
9
10 <pre><code>version: 1
11 Date:    30 mai 2016
12 Author:  José Bollo
13 </code></pre>
14
15 <p><ul>
16  <li><a href="#Overview.of.AFB-DAEMON">Overview of AFB-DAEMON</a>
17  <ul>
18   <li><a href="#Roles.of.afb-daemon">Roles of afb-daemon</a></li>
19   <li><a href="#Use.cases.of.the.binder.afb-daemon">Use cases of the binder afb-daemon</a>
20   <ul>
21    <li><a href="#Remotely.running.application">Remotely running application</a></li>
22    <li><a href="#Adding.native.features.to.HTML5.QML.applications">Adding native features to HTML5/QML applications</a></li>
23    <li><a href="#Offering.services.to.the.system">Offering services to the system</a></li>
24   </ul>
25   </li>
26   <li><a href="#The.plugins.of.the.binder.afb-daemon">The plugins of the binder afb-daemon</a></li>
27  </ul>
28  </li>
29 </ul></p>
30
31 <a name="Roles.of.afb-daemon"></a>
32 <h2>Roles of afb-daemon</h2>
33
34 <p>The name <strong>afb-daemon</strong> stands for <em>Application
35 Framework Binder Daemon</em>. That is why afb-daemon
36 is also named <strong><em>the binder</em></strong>.</p>
37
38 <p><strong>Afb-daemon</strong> is in charge to bind one instance of
39 an application to the AGL framework and AGL system.</p>
40
41 <p>On the following figure, you can use a typical use
42 of afb-daemon:</p>
43
44 <p><a id="binder-fig-basis"><h4>Figure: binder afb-daemon, basis</h4></a></p>
45
46 <pre><code>. . . . . . . . . . . . . . . . . . . . . . . . . .
47 .        Isolated security context                .
48 .                                                 .
49 .        +------------------------------+         .
50 .        |                              |         .
51 .        |    A P P L I C A T I O N     |         .
52 .        |                              |         .
53 .        +--------------+---------------+         .
54 .                       |                         .
55 .                       |                         .
56 .   +-------------------+----------------------+  .
57 .   |                            :             |  .
58 .   |        b i n d e r         :             |  .
59 .   |    A F B - D A E M O N     :   PLUGINS   |  .
60 .   |                            :             |  .
61 .   +-------------------+----------------------+  .
62 .                       |                         .
63 . . . . . . . . . . . . | . . . . . . . . . . . . .
64                         |
65                         v
66                    AGL SYSTEM
67 </code></pre>
68
69 <p>The application and its companion binder run in secured and isolated
70 environment set for them. Applications are intended to access to AGL
71 system through the binder.</p>
72
73 <p>The binder afb-daemon serves multiple purposes:</p>
74
75 <ol>
76 <li><p>It acts as a gateway for the application to access the system;</p></li>
77 <li><p>It acts as an HTTP server for serving files to HTML5 applications;</p></li>
78 <li><p>It allows HTML5 applications to have native extensions subject
79 to security enforcement for accessing hardware ressources or
80 for speeding parts of algorithm.</p></li>
81 </ol>
82
83
84 <a name="Use.cases.of.the.binder.afb-daemon"></a>
85 <h2>Use cases of the binder afb-daemon</h2>
86
87 <p>This section tries to give a better understanding of the binder
88 usage through several use cases.</p>
89
90 <a name="Remotely.running.application"></a>
91 <h3>Remotely running application</h3>
92
93 <p>One of the most interresting aspect of using the binder afb-daemon
94 is the ability to run applications remotely. This feature is
95 possible because the binder afb-daemon implements native web
96 protocols.</p>
97
98 <p>So the <a href="#binder-fig-1">figure binder, basis</a> would become
99 when the application is run remotely:</p>
100
101 <p><a id="binder-fig-remote"><h4>Figure: binder afb-daemon and remotely running application</h4></a></p>
102
103 <pre><code>             +------------------------------+
104              |                              |
105              |    A P P L I C A T I O N     |
106              |                              |
107              +--------------+---------------+
108                             |
109                        ~ ~ ~ ~ ~ ~
110                       :  NETWORK  :
111                        ~ ~ ~ ~ ~ ~
112                             |
113 . . . . . . . . . . . . . . | . . . . . . . . . . . . . .
114 . Isolated security         |                           .
115 .   context                 |                           .
116 .                           |                           .
117 .     . . . . . . . . . . . . . . . . . . . . . . . .   .
118 .     .                                             .   .
119 .     .               F I R E W A L L               .   .
120 .     .                                             .   .
121 .     . . . . . . . . . . . . . . . . . . . . . . . .   .
122 .                           |                           .
123 .       +-------------------+----------------------+    .
124 .       |                            :             |    .
125 .       |    A F B - D A E M O N     :   PLUGINS   |    .
126 .       |                            :             |    .
127 .       +-------------------+----------------------+    .
128 .                           |                           .
129 . . . . . . . . . . . . . . | . . . . . . . . . . . . . .
130                             |
131                             v
132                        AGL SYSTEM
133 </code></pre>
134
135 <a name="Adding.native.features.to.HTML5.QML.applications"></a>
136 <h3>Adding native features to HTML5/QML applications</h3>
137
138 <p>Applications can provide with their packaged delivery a plugin.
139 That plugin will be instanciated for each application instance.
140 The methods of the plugin will be accessible by applications and
141 will be excuted within the security context.</p>
142
143 <a name="Offering.services.to.the.system"></a>
144 <h3>Offering services to the system</h3>
145
146 <p>It is possible to run the binder afb-daemon as a daemon that provides the
147 API of its plugins.</p>
148
149 <p>This will be used for:</p>
150
151 <ol>
152 <li><p>offering common APIs</p></li>
153 <li><p>provide application&rsquo;s services (services provided as application)</p></li>
154 </ol>
155
156
157 <p>In that case, the figure showing the whole aspects is</p>
158
159 <p><a id="binder-fig-remote"><h4>Figure: binder afb-daemon for services</h4></a></p>
160
161 <pre><code>. . . . . . . . . . . . . . . . . . . . . . 
162 .  Isolated security context application  . 
163 .                                         . 
164 .    +------------------------------+     . 
165 .    |                              |     . 
166 .    |    A P P L I C A T I O N     |     . 
167 .    |                              |     . 
168 .    +--------------+---------------+     .     . . . . . . . . . . . . . . . . . . . . . .
169 .                   |                     .     .        Isolated security context A      .
170 .                   |                     .     .                                         .
171 . +-----------------+------------------+  .     . +------------------------------------+  .
172 . |                        :           |  .     . |                        :           |  .
173 . |      b i n d e r       :           |  .     . |      b i n d e r       :  service  |  .
174 . |  A F B - D A E M O N   :  PLUGINS  |  .     . |  A F B - D A E M O N   :  PLUGINS  |  .
175 . |                        :           |  .     . |                        :     A     |  .
176 . +-----------------+------------------+  .     . +-----------------+------------------+  .
177 .                   |                     .     .                   |                     .
178 . . . . . . . . . . | . . . . . . . . . . .     . . . . . . . . . . | . . . . . . . . . . .
179                     |                                               |
180                     v                                               v
181          ================================================================================
182                                      D - B U S   &amp;   C Y N A R A
183          ================================================================================
184                     ^                                               ^
185                     |                                               |
186 . . . . . . . . . . | . . . . . . . . . . .     . . . . . . . . . . | . . . . . . . . . . .
187 .                   |                     .     .                   |                     .
188 . +-----------------+------------------+  .     . +-----------------+------------------+  .
189 . |                        :           |  .     . |                        :           |  .
190 . |      b i n d e r       :  service  |  .     . |      b i n d e r       :  service  |  .
191 . |  A F B - D A E M O N   :  PLUGINS  |  .     . |  A F B - D A E M O N   :  PLUGINS  |  .
192 . |                        :     B     |  .     . |                        :     C     |  .
193 . +------------------------------------+  .     . +------------------------------------+  .
194 .                                         .     .                                         .
195 .        Isolated security context B      .     .        Isolated security context C      .
196 . . . . . . . . . . . . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . .
197 </code></pre>
198
199 <a name="The.plugins.of.the.binder.afb-daemon"></a>
200 <h2>The plugins of the binder afb-daemon</h2>
201
202 <p>The binder can instanciate plugins. The primary use of plugins
203 is to add native methods that can be accessed by applications
204 written with any language through web technologies ala JSON RPC.</p>
205
206 <p>This simple idea is declined to serves multiple purposes:</p>
207
208 <ol>
209 <li><p>add native feature to applications</p></li>
210 <li><p>add common API available by any applications</p></li>
211 <li><p>provide customers services</p></li>
212 </ol>
213
214
215 <p>A specific document shows</p>
216 </body>
217 </html>