|I am often asked for advise on how to structure the
libraries within a PowerBuilder application and asked if there is a
maximum number of objects that should be stored in a library. Then there
is the old myth about a "Maximum physical library size of
1Mb". Firstly let me start by saying ignore the old 1Mb physical
file size, this was a rule of thumb used many many moons ago in the
PowerBuilder 3 time frame and no longer applies.
The following set of guidelines are based on experience of many years
of development and many applications developed in PowerBuilder both by
myself and countless other applications developed by other people.
The main goal of your library structure should be to make finding the
object you as a developer needs to edit as quick and easy as possible.
As the size of the application grows you will not be able to remember
the location of every object and component so a good library list helps
you and other people new to the project quickly navigate to the code you
require. Obviously too many objects in a library makes it difficult to find the one you want and too many
libraries has the same problem.
I would not recommend storing objects in libraries by object type,
for example having a library for windows, one for datawindows etc. The
PowerBuilder development environment already sorts the objects by type
for you and you can also use the filtering to display only the windows
or only the datawindows.
The best way to structure your libraries is by major
application function area and size. For example in the application I am currently working on we have a
library for most of the major application functions with an average of 30 - 40 objects in each one, but the reports and
lookup table maintenance objects which are smaller and less complex are lumped into 2
libraries one for all reports and one for all simple lookup table maintenance type windows and business objects.
This makes it very easy to locate the object you are looking for but in
the case of the maintenance function is would have been an over kill to
have 10 libraries one for each lookup table each with only 3 objects in
(datawindow, window and business object). By putting them all in a
single library we reduced the number of libraries by 9 making the
library list easier to read but we still have a quick and easy way to
locate the objects.