afb-apiset: Fix start of apis
[src/app-framework-binder.git] / docs / afb-overview.md
1 # Binder Overview
2
3 The ***binder*** provides the way to connect applications to
4 the services that it needs.
5
6 It provides a fast way to securely offer APIs to applications
7 written in any language and running almost anywhere.
8
9 - The ***binder*** is developed for AGL (Automotive Grade Linux) but it is not bound to AGL.
10 - The ***binder*** is the usual name.
11 - The binary is named **afb-daemon**.
12 - The name **afb-daemon** stands for ***Application Framework Binder Daemon***.
13
14 The word *daemon*, here, denote the fact that the ***binder*** makes witchcraft to
15 connect applications to their expected services. (note: that usually the term of 
16 daemon denotes background process but not here).
17
18 Each ***binder*** **afb-daemon** is in charge to bind one instance of 
19 an application or service to the rest of the system, applications and services.  
20 Within AGL, the connection between services and/or applications 
21 is tuned by the AGL framework and the AGL system.
22
23 ## The basis of the binder
24
25 The following figure shows main concepts linked to the ***binder***.
26
27 <a id="fig-binder-basis"></a>
28 ![Figure: binder basis](pictures/basis.svg)
29
30 The shown elements are:
31
32 - The SECURITY CONTEXT
33
34   The primary intention of any ***binder*** is to provide
35   a secured environment for any application.  
36   On AGL, the   **security context** is ensured by [Smack] 
37   , the security context of the application or service.
38
39 - The BINDER
40
41   This is the central element.  
42   It makes possible to run HTML5 applications and provides 
43   the unified access to APIs provided by the ***bindings***.
44
45   Running a pure HTML5 application doesn't require any ***binding***.  
46   In that case , the ***binder*** acts as a simple HTTP server for
47   the web runtime.
48
49 - The BINDINGs
50
51   A ***binding*** adds one **API** to the ***binder***.
52
53   An **API** is a set of **verbs** that can be called
54   using either REST over HTTP or a kind of JSON RPC.
55
56   ***bindings*** are either:
57
58   - dynamically loaded libraries in the ***binder*** process
59   - remote service running on the same host
60   - remote service running on other hosts
61
62   When acting as an HTTP server, the binder treats the language
63   settings of the HTTP requests to provide internationalized
64   content as specified by
65   [widget specifications](https://www.w3.org/TR/widgets/#internationalization-and-localization).
66 - The APPLICATION
67
68   An ***application*** connects to the binder to get access to
69   the **API** that it provides or to get its HTTP services to access
70   resources.
71
72 <!-- pagebreak -->
73
74 ## Interconnection of binders
75
76 The AGL framework interprets the **widget/application** manifests
77 to setup the ***bindings*** configuration of the ***binders***.
78
79 The figure below shows that ***binders*** are interconnected.
80
81 <a id="fig-binder-interconnection"></a>
82 ![Figure: binder interconnection](pictures/interconnection.svg)
83
84 The figure shows 4 several **application/service**: **A**, **B**,
85 **C** and **D**.
86
87 The application **A** might use an **API** that is shown as a
88 local ***binding*** but that in reality runs within the context
89 of **D**.
90
91 The framework AGL takes care of making the plumbing working.