Tuesday 20 November 2018

Generating and Installing Operations Libraries

When considering how to implement the generation editors for Studio Developer, one of the decisions taken was to have separate editors for online, batch and window code like the legacy Gen toolset, but also to separate client and server generation into separate editors. This mean that you could have both the client and server editors open simultaneously and also specify different target properties for each, for example Windows/C for clients and MVS/COBOL for servers.

However we also had to consider how to best handle operations libraries.

The Gen toolset has a separate window for these, but we did not feel that this was the best approach since it meant that you would either have to have one additional editor for all operations libraries which could then generate either client code or server code, or have two, one for client and one for server. But what about windowed load modules if these are also required?

Instead of having a separate editor, we decided to include the generation of operations libraries within the scope of the existing generation editors, i.e. client, server, online, etc.

This then lead to the problem of what operations libraries are generated? Should it display all of them for each target environment? What if some of the opslibs are for the client and others for the server? You would not want to generate the server opslibs when generating the client code and vice-versa.

One approach would be to present all of the opslibs and allow the developer to select which ones are to be generated and installed. The issue here is that as explained in a previous post, Studio Developer will automatically select changed action blocks for generation and installation, so if for example the client code generation editor was open and a server action block was changed, the opslib would be selected for client generation and installation.

The solution that we came up with was to provide an option for defining a filter that specifies which opslibs are included for each editor. The generation options dialog allows you to specify an include filter and an exclude filter. For example you could specify an include filter of CL% for client generation which means that only opslibs that start CL are included. For server generation you could then specify the exclusion filter of CL% which means that all opslibs are included except those that start CL. This approach does rely on a structured naming convention for the operation library names.


No comments: