• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# FA Model Overview
2
3## Overall Architecture
4The development of an OpenHarmony application is essentially the development of one or more abilities. By scheduling abilities and managing their lifecycle, OpenHarmony implements application scheduling.
5
6The Feature Ability (FA) model applies to application development using API version 8 and earlier versions. In this model, there are Page, Service, Data, and Form abilities.
7- The Page ability implements the ArkUI and provides the capability of interacting with users.
8- The Service ability does not have a UI. It runs in the background and provides custom services for other abilities to invoke.
9- The Data ability does not have a UI. It runs in the background and enables other abilities to insert, delete, and query data.
10- The Form ability provides a widget, which is a UI display mode.
11
12## Application Package Structure
13
14The following figure shows the application package structure.
15
16![fa-package-info](figures/fa-package-info.png)
17
18For details about the application package structure, see [Description of the Application Package Structure Configuration File](../quick-start/package-structure.md).
19
20## Lifecycle
21
22Among all abilities, the Page ability has the most complex lifecycle, because it has a UI and acts as a touchpoint for interacting with users.
23**The following figure shows the lifecycle of the Page ability.**
24
25![fa-pageAbility-lifecycle](figures/fa-pageAbility-lifecycle.png)
26
27The other abilities do not involve the foreground/background switchover and the **onShow** callback.
28You can override the lifecycle callbacks in **app.js/app.ets** to process application logic.
29
30Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks.
31
32
33## Process and Thread Model
34An application exclusively uses an independent process, and an ability exclusively uses an independent thread. When an ability is started for the first time, an application process as well as a thread for this ability is created. After the application is started, other abilities in the application are started, and a thread is created for every of these started abilities. Each ability is bound to an independent JSRuntime instance. In this way, abilities are isolated from each other.
35
36![fa-threading-model](figures/fa-threading-model.png)
37