Whenever you save an object, such as a window or menu, in a painter, PowerBuilder stores the object in a library file (for the workspace) or under a library folder (for the solution). Similarly, whenever you open an object in a painter, PowerBuilder retrieves the object from the library file or folder.
Assigning libraries
Application targets/projects can use as many libraries as you want. Libraries can be on your own computer or on a server. When you create a target/project, you specify which libraries it uses. You can also change the library search path for a target/project at any time during development.
For information about specifying the library search path, see Specifying the target/project's library search path.
How the information is saved
The object is saved in two forms:
-
Source form
This is a syntactic representation of the object, including the script code. You can Edit or Edit Source of an object in the PowerBuilder code editor.
-
Object form
PowerBuilder compiles an object automatically every time you save it.
In a workspace, the object is saved in the binary format and more than one object is saved in one consolidated library file, similar to the object file in the C and C++ languages. Supports machine code or Pcode.
In a solution, the object is saved in the plain text format and every object is saved in a singular file. Supports Pcode only.
The library is saved in different forms in the workspace and solution:
-
In a workspace, the library is saved as a file with file extension .pbl.
-
In a solution, the library is saved as a folder (the folder name is appended with .pbl at the end).
It is hard to predict the needs of a particular application, so the organization of a target/project's libraries generally evolves over the development cycle. PowerBuilder lets you reorganize your libraries easily at any time.
About library size
For small applications, you might use only one library, but for larger applications, you should split the application into different libraries.
There are no limits to how large libraries can be, but for performance and convenience, you should follow these guidelines:
-
Number of objects
It is a good idea not to have more than 50 or 60 objects saved in a library. This is strictly for your convenience; the number of objects does not affect performance. If you have many objects in a library, list boxes that list library objects become unmanageable and the System Tree and Library painter become more difficult to use.
-
Balance
Managing a large number of libraries with only a few objects makes the library search path too long and can slow performance by forcing PowerBuilder to look through many libraries to find an object. Try to maintain a balance between the size and number of libraries.
You can organize your libraries any way you want. For example, you might put all objects of one type in their own library, or divide your target/project into subsystems and place each subsystem in its own library.
The project administrator must design a directory hierarchy for the project's workspace/solution. The administrator might create a separate subdirectory for each target/project in the workspace/solution, or for each library in the workspace/solution. After the administrator sets up the project and registers every object in the workspace/solution, individual developers copy a template workspace/solution to their own computers, open the workspace/solution, and connect to source control.
PowerBuilder provides basic source control using the PBNative check in/check out utility; and also provides a direct connection to external SCC-compliant source control systems. For more about using PBNative and other source control systems, see Using a source control system with PowerBuilder.