Pegasus Enhancement Proposal (PEP) 347

PEP#: 347

PEP Type: Functional

Title: Separate internal modules from current libpegcommon library

Version: 1.1

Created: 2nd March 2009

Authors: Thilo Boehm

Status:  Approved

Version History:

Version Date Author Change Description
0.1 18 March 2009 Thilo Boehm  Initial Submission
0.2 20 March 2009
Thilo Boehm
Discussion Arch Call 03/19
  • Drop the extra include path
  • Still name finding of the new library
    • Define criteria to identify modules for new library
1.0
27 March 2009
Thilo Boehm
Final version for ballot
1.1
16 April 2009
Thilo Boehm
Approved version, including final comments.

 


Abstract:

This PEP proposes to separate internal used modules, not using the external interface or dependent modules, from the current libpegcommon library in to a new separate library to reduce the size of the libpegcommon, allow to add internal only classes with out interfering the external interface, and moderate the degree to which internal classes are included in an SDK library.


1. Definition of the Problem

Historically the Pegasus common library libpegcommon has become the home of all kinds of commonly used functions and classes in OpenPegasus. This includes classes which are part of the external interface defined in PEP#344 as well as classes used internally for the implementation of the cimserver, not meant for usage by any external project.

The mixture of internal and external interfaces as well as the overall size of the common library has become a major concern. Keep on adding new function to libpegcommon unnecessarily grows the size of client applications and further raises the risk of breaking the external interfaces or unintended use of internal only functions by exploiting client applications or C++ CIM Providers.

2. Proposed Solution

To reduce the size of the common library, enable OpenPegasus to add internal only classes with out extending the libpegcommon, and to lower the risk of breaking the external interfaces while implementing enhancements for OpenPegasus,  a new library should be created for OpenPegasus. The new library should contain as many of the internal only classes from libpegcommon as possible. New functions/classes, not meant for external use should also go to this new library.

To be able to change the internals without changing the external interface the current libpegcommon has to be split into two libraries.
But the interfaces are so interweaved, that it is not easy to split such that the external interfaces are not broken.


This PEP proposes a start by migrating modules from the libpegcommon into a separate library.

The proposed name for the new library is libpeggeneral and resides in pegasus/src/Pegasus/General

The selection criteria for modules to be moved from libpegcommon to libpeggeneral is that these modules are not used directly or indirectly by the external interface.
The rationale for this criteria is, not to break the SDK and linkage on any platforms.

The modules of the new library are only used by server provided tools and server internal libraries.

The build order is first build libpegcommon then build libpeggeneral. 
libpeggeneral can be linked to libpegcommen to resolve its dependencies but not vice versa.
libpegclient is only linked to libpegcommen.





This is the list identified modules of libpegcommon for libpeggeneral library:

CIMError.cppSetFileDescriptorToEBCDICEncoding.h IndicationFormatter.h
CIMError.hMofWriter.cppIndicationFormatter.cpp
DynamicLibrary.cppMofWriter.hSSLContextManager.cpp
DynamicLibrary.hOptionManager.cppSSLContextManager.h
DynamicLibraryPOSIX.cppOptionManager.hStopwatch.cpp
DynamicLibraryWindows.cppPropertyAccessor.cppStopwatch.h

PropertyAccessor.h


Testing

All corresponding tests are moved to src/Pegasus/General/tests

This is the list of tests  to be move from Pegasus/Common/tests to Pegasus/General/tests:

CIMError
DynamicLibrary
IndicationFormatter
OptionManager
Stopwatch
ToMof

Implementation

The necessary changes to establish libpeggeneral is done in 2 Steps.
The 2 Steps should be done very closely not to cause a NbaT break.

The changes are done on the head of CVS.

Step1

In step1 only the movement of the files is done.
A script will be provided with the neccesarry CVS commands to delete the files from /directories from src/Pegasus/Common and create the files in src/Pegasus/General.
The delete/create steps are committed with the appropriate comment, where the files is moved to/where it comes from.

Step 2

In step 2 the necessary changes to the files are done to reflect the movement of the files into libpeggeneral.

Schedule

OpenPegasus 2.10

Appendix

During doing analyzes for this PEP some general findings are made.
These findings are will be filed as separate Bugs independent from this PEP:

Finding 1

CIMNamedUnchecked.h is still part of the libpegcommon. It was replaced by CIMNameCast.h ( Bug# 8097 ).
This finding has been resolved with Bug# 8468

Finding 2

The following modules are only used with in the Repository. So they have to be part of the lippegrepository.

AutoStreamer.cppAutoStreamer.hBinaryStreamer.cppBinaryStreamer.h
Packer.cpp Packer.h XmlStreamer.cpp XmlStreamer.h
ObjectStreamer.h



Finding 3

QueryExpressionRep.h & QueryExpressionRep.cpp should be part of libpegqueryexpression:

Three modules are using this class:
Pegasus/Server/CIMOperationRequestDispatcher and Pegasus/WQL/WQLQueryExpressionRep
But Pegasus/ProviderManager2/QueryExpressionFactory is not.
 

Future Work

There is still potential in the libpegcommon for modules to be moved to libpeggeneral but this needs rework of other modules.



Licensed to The Open Group (TOG) under one or more contributor license agreements. Refer to the OpenPegasusNOTICE.txt file distributed with this work for additional information regarding copyright ownership. Each contributor licenses this file to you under the OpenPegasus Open Source License; you may not use this file except in compliance with the License.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


 

Template last modified: December 18th 2008 by Martin Kirk
Template version: 1.12