目录

Solution Design

Multi-team Development

If an application and an atomic service are developed by different teams, build them in separate projects while enabling code reuse.

[h2]Solution Without Atomic Service Bundle Splitting

For scenarios where atomic service bundles are not split, this solution is recommended for code reuse.

Using HAR: In an atomic service project, build reusable function modules using HAR. The application then reuses the atomic service's code via the HAR. The solution is designed as in the figure below.

[h2]Solution with Atomic Service Bundle Splitting

In this scenario, there are two code reuse solutions: use solution 1 if the application supports on-demand loading; otherwise, use solution 2.

Single-team Development

If an application and an atomic service are developed by the same team, it is recommended to use multi-target builds in DevEco Studio to develop both within the same project simultaneously.

[h2]Solution Without Atomic Service Bundle Splitting

For scenarios where atomic service bundles are not split, this solution is recommended for code reuse.

Using HAR: In the project, build reusable function modules using HAR. The application then reuses the atomic service's code through this shared HAR. The solution is designed as in the figure below.

[h2]Solution with Atomic Service Bundle Splitting

In this scenario, there are two code reuse solutions: use solution 1 if the application supports on-demand loading; otherwise, use solution 2.