About libraries
Whenever you save an object, such as a window or menu, in
a painter, PowerBuilder stores the object in a library (a PBL file).
Similarly, whenever you open an object in a painter, PowerBuilder
retrieves the object from the library.
Assigning libraries
PowerScript targets can use as many libraries as you want.
Libraries can be on your own PC or workstation or on a server. When
you create a target, you specify which libraries it uses. You can
also change the library search path for a target at any time during
development.
For information about specifying the library
search path, see “Specifying the target’s
library search path”.
How the information is saved
Every object is saved in two parts in a library:
- Source
form This is a syntactic representation of the object, including the
script code. - Object form This is a binary representation of the object, similar to
an object file in the C and C++ languages. PowerBuilder
compiles an object automatically every time you save it.
Using libraries
It is hard to predict the needs of a particular application,
so the organization of a target’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.
Organizing 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 into subsystems and place each subsystem in its own
library.
Sharing objects with others
PowerBuilder provides basic source control using the PBNative
check in/check out utility. PBNative allows you to lock
the current version of PowerBuilder objects and prevents others
from checking out these objects and modifying them while you are
working on them.
The project administrator must design a directory hierarchy
for the project’s workspace. The administrator might create
a separate subdirectory for each target in the workspace, or for
each PBL in the workspace. After the administrator sets up the project
and registers every object in the workspace, individual developers
copy a template workspace to their own computers, open the workspace,
and connect to source control.
PowerBuilder 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”.