first stab at a design where each incoming API call has its own dbsession
[sfa.git] / sfa / generic / architecture.txt
1 We identify 3 layers in the server-side aspects:
2
3 . api: this object reacts to an incoming SFA request
4
5 . manager: this implements a given interface, either registry,
6 aggregate, or slicemgr
7
8 . driver: this object is in charge of actually talking to the
9 underlying testbed
10
11 -----
12
13 the generic layer is in charge of instantiating these and to link them
14 as follows:
15 * the classes actually used for creating the 3 elements are
16 configurable in a flavour (e.g. sfa.generic.pl.py)
17 * which is then configured from sfa-config-tty as SFA_GENERIC_FLAVOUR
18
19 * a call to make_api will then create the 3 elements with the
20   following layout:
21
22 api.manager 
23 manager.driver
24 api.driver (for convenience)
25 driver.api
26
27 ------
28 example
29
30 from sfa.generic import Generic
31 generic=Generic.the_flavour()
32 -> returns an instance of a Generic object with a flavour from the
33    config; by default it would thus be an instance of sfa.generic.pl
34
35 api = generic.make_api (...) returns an instance of the given class
36 with the arguments passed as arguments to the constructor
37
38 ------
39 more in sfa/generic/__init__.py
40
41