Bug 1879146 - Move mozac.org docs back into the android-components folder. r=owlish...
[gecko.git] / mobile / android / android-components / docs / contribute / architecture.md
blob4b6ed25037c2247a1fe620f5c1f9e951b325e01c
1 ---
2 layout: page
3 title: Architecture and Overview
4 permalink: /contributing/architecture
5 ---
7 # Architecture and Overview
9 Our main design goal is to provide independently reusable Android components. We strive to keep dependencies between components as minimal as possible. However, standalone components aren't always feasible, which is why we have grouped components based on their interactions and dependencies.
11 On the lowest level, we provide standalone UI components (e.g. autocomplete, progressbar, colors) as well as independent service and support libraries (e.g. Telemetry, Kotlin extensions and Utilities).
13 The second level consist of so called `Concept` modules. These are abstractions that describe contracts for component implementations such as `Engine` or `Session Storage`, which may in turn have multiple implementations. The purpose of these concepts is to allow for customization and pluggability. Therefore, where available, components should always depend on concept modules (not their implementations) to support bringing in alternative implementations.
15 On top of `Concept` modules we provide `Browser` components. These components provide browser-specific functionality by implementing concepts and using lower level components.
17 On the highest level, we provide `Feature` components which provide use case implementations (e.g search, load URL). Features can connect multiple `Browser` components with concepts, and will therefore depend on other components.
19 The following diagram does not contain all available components. See [Components]({{ site.baseurl }}/components/) for a complete and up-to-date list.
21 ```
22     ┌─────────────────────┬───────────────────────────────────────────────────────────────────────┐
23     │                     │ ┌───────────────────────────────────────────────────────────────────┐ │
24     │                     │ │                              Feature                              │ │
25     │  Features combine   │ │ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─   ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─  │ │
26     │ browser components  │ │       Session      │         Toolbar      │         Search      │ │ │
27     │    with concepts    │ │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─    └ ─ ─ ─ ─ ─ ─ ─ ─ ─   └ ─ ─ ─ ─ ─ ─ ─ ─ ─  │ │
28     │                     │ └───────────────────────────────────────────────────────────────────┘ │
29     ├─────────────────────┼───────────────────────────────────────────────────────────────────────┤
30     │                     │ ┌───────────────────────────────────────────────────────────────────┐ │
31     │                     │ │                              Browser                              │ │
32     │ Browser components  │ │ ┌ ─ ─ ─ ─ ─ ─ ┐ ┌ ─ ─ ─ ─ ─ ─ ┐  ┌ ─ ─ ─ ─ ─ ─ ┐  ┌ ─ ─ ─ ─ ─ ─ ┐ │ │
33     │   may implement     │ │  Engine-Gecko       Search           Toolbar        Errorpages    │ │
34     │  concepts and use   │ │ └ ─ ─ ─ ─ ─ ─ ┘ └ ─ ─ ─ ─ ─ ─ ┘  └ ─ ─ ─ ─ ─ ─ ┘  └ ─ ─ ─ ─ ─ ─ ┘ │ │
35     │    lower level      │ │ ┌ ─ ─ ─ ─ ─ ─ ┐ ┌ ─ ─ ─ ─ ─ ─ ┐  ┌ ─ ─ ─ ─ ─ ─ ┐  ┌ ─ ─ ─ ─ ─ ─ ┐ │ │
36     │     components      │ │  Engine-System      Session          Domains           Menu       │ │
37     │                     │ │ └ ─ ─ ─ ─ ─ ─ ┘ └ ─ ─ ─ ─ ─ ─ ┘  └ ─ ─ ─ ─ ─ ─ ┘  └ ─ ─ ─ ─ ─ ─ ┘ │ │
38     │                     │ └───────────────────────────────────────────────────────────────────┘ │
39     ├─────────────────────┼───────────────────────────────────────────────────────────────────────┤
40     │                     │ ┌───────────────────────────────────────────────────────────────────┐ │
41     │  Abstractions and   │ │                              Concept                              │ │
42     │   contracts for     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
43     │     component       │ │               Engine          │             Toolbar          │    │ │
44     │  implementations    │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
45     │                     │ └───────────────────────────────────────────────────────────────────┘ │
46     ├─────────────────────├───────────────────────────────────────────────────────────────────────┤
47     │                     │ ┌────────────────────────────────┐ ┌────────────────────────────────┐ │
48     │                     │ │               UI               │ │            Service             │ │
49     │     Standalone      │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
50     │     components      │ │          Autocomplete     │    │ │           Telemetry       │    │ │
51     │                     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
52     │                     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ └────────────────────────────────┘ │
53     │                     │ │            Progress       │    │ ┌────────────────────────────────┐ │
54     │                     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │            Support             │ │
55     │                     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
56     │                     │ │             Colors        │    │ │       Kotlin extensions   │    │ │
57     │                     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
58     │                     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
59     │                     │ │             Fonts         │    │ │           Utilities       │    │ │
60     │                     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │
61     │                     │ │    ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │                                │ │
62     │                     │ │             Icons         │    │ │                                │ │
63     │                     │ │    └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─     │ │                                │ │
64     │                     │ └────────────────────────────────┘ └────────────────────────────────┘ │
65     └─────────────────────┴───────────────────────────────────────────────────────────────────────┘
66 ```