Library part
Library parts support the sharing of functions and variables.
A Library part has the following characteristics:
- A Library part is a main logic part with multiple entry points.
- Library elements are accessed by direct calls to the shared Library functions or by direct references to the shared Library variables.
- Library parts for Java™ and COBOL generation typically use the BasicLibrary stereotype (see BasicLibrary stereotype). The RUIPropertiesLibrary stereotype is available for Rich UI (see RUIPropertiesLibrary stereotype). EGL also includes a NativeLibrary stereotype for i4GL compatibility (see NativeLibrary stereotype).
- A Library is generated separately from the parts that use it.
- At run time, a Library loads the first time you use it and unloads when the run unit ends.
- If a Library invokes another Library, the invoked Library remains in memory as long as the invoking Library does.
For more information on libraries, see Introduction to Library parts.
For information on library properties, see Library properties.
Syntax

- libraryName
- The name that you assign to the library.
- libraryType
- A stereotype to specialize the library.
- libraryFunctions
- EGL functions that other logic parts can call from this library. Other logic parts cannot call Library functions that are labeled with the private keyword.
- libraryVars
- Variables or constants that other logic parts can reference from this library. Other logic parts cannot reference Library variables that are labeled with the private keyword.
Compatibility
| Platform | Issue |
|---|---|
| COBOL generation | The maximum length for a generated library name is 8 characters. |
| JSF | A JSF handler gets a new copy of the library whenever the handler is loaded. |
| Rich UI | For details on Rich UI compatibility issues, see Starting to work with EGL Rich UI. |
| Text UI | Library functions cannot use the converse, display, or show statements, nor access text forms. A library that accesses a print form must include a use statement for the related form group. The library is reloaded when a segmented Text UI program does a converse or show. |
| Web transactions | Library functions cannot use the converse or show statements. Web transactions area always segmented, so the Library is reloaded when the program does a converse or show. |