Table Of Contents

Componentizing Applications

Last Modified: August 9, 2019

Componentizing an application helps you organize code into logical groups, save time from creating duplicate code, and enhance software stability. Use Application and Library documents to create component-based applications, in which you compose loosely coupled code into modular and cohesive projects.

The following figure demonstrates how to convert a project with loosely coupled code into a component-based project.

When you build the application, all dependency libraries are built into G loadable libraries (.gll) along with the top-level application. The following figure shows an example of the build result.

Best Practices for Componentizing Applications

Consider the following guidelines when componentizing an application:

  • Keep application components small and self-contained.
  • Put code that you might reuse in a separate Library document.
  • Create namespaces to organize files into logical groups. For example, you can put all classes in a Library document under the same namespace.
  • Do not create circular dependencies between libraries, which cause problems such as build failures.
  • Analyze your application composition frequently and look for opportunities to refactor code. Understand code dependency guidelines when you refactor code.

Recently Viewed Topics