Libraries

Warning: this feature is experimental

AF3 Library enables the reuse of components, user defined data types and functions.

Library View

To toggle between the projects and library views, click on the following icon.



Creating and organizing a library

A library can be created by clicking on the following icon.



Once a library is created, you can change its name. A file in the workspace AF3-Lib directory is associated to each library. This file is accessible by switching to the Storage perspective. In the next picture we can see the structure of workspace after creating a library called "MathLib".



The content of a library is structured in packages. A package can contain sub-packages or library components. To create a package, right-click on the library and select New package. To create a sub-package, right-click on a package and select New package.



Adding Components to a Library

To add a component to a library, right-click on the component and select the Add to Library menu entry. Next, you should select the package that will contain the component.



When changing to the library view, a component that belongs to a library is displayed below the corresponding package as shown below.



Important: before a library component can be used in a project, the library MUST be saved.

Adding User Defined Functions and Types to a Library

To add a user defined type (or user defined function) to a library, right-click on the type (or function) from the data-dictionary and select the Add to Library menu entry. Next, you should select the package where the component is saved in.







When changing to the library view, the functions and types will be visible in the library under the corresponding package as shown below.



Using Library Components in AF3 Projects

Available library components are shown in the Model Elements view as shown below. To create a reference, just drag and drop the library component to the diagram.



If a library component is changed (in the library view), the change is propagated to all references immediately after saving its corresponding library.

Disconnecting Components from a Library

A component reference can be disconnected from a library. In this case, changes are no more propagated from the library and the component can be changed independently of other library components. To disconnect a component from a library, right-click on the component and select Disconnect from Library.



Using Library Functions and Types in AF3 Projects

Available library functions and types are shown in the Model Elements view as illustrated below. To create a reference, just drag and drop the library function / type into a data-dictionary.



Once functions are saved into a library, they can be referenced also from other library packages that contain a data-dictionary. In this manner, user defined functions and types can be used within library components.