From 09:00 PM Friday, August 7 - 10:30 AM CST Saturday, August 8, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Table Of Contents

Componentizing Applications

Version:
Last Modified: April 15, 2020

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.
  • Store code that you might reuse in a separate Library document.
  • Create namespaces to organize files into logical groups. For example, you can group all classes in a Library document under the same namespace.
  • Avoid creating circular dependencies between libraries, which cause problems such as build failures.
  • Analyze your application composition frequently for opportunities to refactor code. Refer to code dependency guidelines when refactoring code.

Recently Viewed Topics