Codestructure, next few lines
[mir.git] / doc / CODESTRUCTURE
1 -------------------------------------------------------------------------------------
2
3 A short intro to the code-structure of Mir
4
5 -------------------------------------------------------------------------------------
6
7 In the java-source tree you will find the following:
8
9  - two classes (OpenMir and Mir)
10  - two packages (mir and mircoders)
11
12
13 Servlets:
14 -------------------------------------------------------------------------------------
15
16 Looking from the request of a client browser onto MIR, the http-request is passed
17 via Apache/Tomcat to either Mir.class or OpenMir.class. Mir.class handles all 
18 request that deal with internal administration tasks of MIR. OpenMir is the
19 Servlet that deals with all open tasks: adding comments or articles/media to
20 the system.
21
22 These servlets don't do much but dispatching the tasks to an underlying code
23 level, called ServletModules. OpenMir.class is basically a special case of Mir.class,
24 no authentication is needed, and only two underlying ServletModule are used.
25
26 The following explanation is about how requests are passed through, and responses
27 to the client-browser are generated. The request has to pass through up to four
28 levels of code (and from there asking the database), until it collected all the
29 necessary data or performed all necessary tasks, to be able to respond.
30
31
32 ServletModules:
33 -------------------------------------------------------------------------------------
34
35 The ServletModules are called via reflection java-api. The http-request parameter
36 "module=XXX" and "do=YYY" are evaluated. A method YYY(HttpRequest,HttpResponse) is
37 called in ServletModuleXXX. 
38
39
40 Modules:
41 -------------------------------------------------------------------------------------
42
43
44 Database/Entity:
45 -------------------------------------------------------------------------------------
46 - db: singeltons, object-representation of db-table, access, generating entities
47 - entity: representation of row
48
49
50 Producer
51 -------------------------------------------------------------------------------------