1e41f4b71Sopenharmony_ci# Component Startup Rules (Stage Model)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciComponent startup refers to the behavior of starting or connecting to an application component.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci- Start the [UIAbility](../reference/apis-ability-kit/js-apis-app-ability-uiAbility.md), ServiceExtensionAbility, and DataShareExtensionAbility components. For example, you can use [startAbility()](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability), **startServiceExtensionAbility()**, [startAbilityByCall()](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilitybycall), and [openLink()](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextopenlink12).
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci- Connect to the ServiceExtensionAbility and DataShareExtensionAbility components. For example, you can use [connectServiceExtensionAbility()](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextconnectserviceextensionability) and **createDataShareHelper()**.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## General Component Startup Rules
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciTo deliver a better user experience, the system restricts the following behavior:
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci- A background application randomly displays a dialog box, such as an ads pop-up.
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci- Background applications wake up each other. This type of behavior occupies system resources and increases power consumption, or even causes system frozen.
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci- A foreground application randomly redirects to another application, for example, redirecting to the payment page of another application. This type of behavior poses security risks.
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ciIn view of this, the system formulates a set of component startup rules, as follows:
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci- Before starting a component of another application, check whether the component can be called by others.
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci  If the **exported** field of the component is set to **true**, the component can be called by other applications. If the field is set to **false**, the component cannot be called by other applications. If this is the case, you must also verify the permission **ohos.permission.START_INVISIBLE_ABILITY**, which is available only for system applications. For details about the **exported** fields, see [abilities](../quick-start/module-configuration-file.md#abilities).
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci- Before starting a UIAbility component of a background application, verify the permission **ohos.permission.START_ABILITIES_FROM_BACKGROUND**, which is available only for system applications.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci  > **NOTE**
32e41f4b71Sopenharmony_ci  > 
33e41f4b71Sopenharmony_ci  > An application is considered as a foreground application only when the application process gains focus or its UIAbility component is running in the foreground.
34e41f4b71Sopenharmony_ci 
35e41f4b71Sopenharmony_ci- Before using **startAbilityByCall()** to start a component running on another device, verify the permission **ohos.permission.DISTRIBUTED_DATASYNC**.
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ciThe preceding component startup rules take effect since API version 9. Familiarity with these rules helps you prevent service exceptions.  
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci## Intra-Device Component Startup Rules
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci  The rules for starting components on the same device vary in the following scenarios:
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci- Starting the UIAbility component
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci- Starting the ServiceExtensionAbility and DataShareExtensionAbility components
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci- Using [startAbilityByCall](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilitybycall) to start the UIAbility component
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci![startup-rule](figures/component-startup-inner-stage.png)
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci## Inter-Device Component Startup Rules
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci  The rules for starting components on a different device vary in the following scenarios:
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci- Starting the UIAbility component
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci- Starting the ServiceExtensionAbility and DataShareExtensionAbility components
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ci- Using [startAbilityByCall](../reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilitybycall) to start the UIAbility component
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci![component-startup-rules](figures/component-startup-inter-stage.png)
65