If an application and an atomic service are developed by different teams, build them in separate projects while enabling code reuse.
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.

In this scenario, there are two code reuse solutions: use solution 1 if the application supports on-demand loading; otherwise, use solution 2.
In the atomic service project, build reusable function modules using the integrated HSP. The application then reuses the atomic service's code via the HSP. The solution is designed as in the figure below.

In the 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.

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.
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.

In this scenario, there are two code reuse solutions: use solution 1 if the application supports on-demand loading; otherwise, use solution 2.
In the project, build reusable function modules using HSP. The application then reuses the atomic service's code through this shared HSP. The solution is designed as in the figure below.

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.
