You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a fairly large refactoring of the Geometry project, with the purpose of simplifying the class hierarchy significantly by folding in Parameterized versions of all the Components into a single class.
'''The design is currently this:'''
a Component object holds the position etc. of an instrument's (base) component.
For a parametrized instrument, a ParametrizedComponent is created which wraps the original Component with the addition of a const reference to a ParameterMap (m_map), as well as a pointer to the base (un-parametrized) Component (m_base).
Every function in Component needs to have the same implemented in ParameterizedComponent.
Most functions in ParameterizedComponent simply call m_base->function(...)
Only a few require actually different behavior (e.g. getting position).
The ParametrizedComponent is created by a factory.
This would not be so bad if there were only Component that needed parametrized version. However, EVERY class in the instrument needs its equivalent Par... version.
This THEN means that there needs to be an IComponent interface to interface between ParametrizedComponent and Component. So for each 1 REAL class, there are 2 MORE classes; triple the complexity!
This is then multiplied by all the classes that have their corresponding ParXXX and IXXX versions:
Component
Instrument
ObjComponent
CompAssembly
ObjCompAssembly
RectangularDetector
'''My proposed design:'''
The Component object will be made to act as either a parametrized Component or a base component.
The new Component ''can'' have a ''pointer'' to a ParameterMap object (m_map) containing its parameters, as well as a pointer to its base Component (m_base)
If it DOES, that means it is a parametrized Component.
Functions called on Component will check if it is parametrized, and act accordingly - either call the unparametrized m_base object, or perform the adjustments required by the ParameterMap.
The ParComponentFactory still acts the same way - except it returns a new instance of Component with the ParameterMap and base set, instead of a different class.
'''Advantages:'''
Two-to-Three-fold reduction in the required number of classes. Some of the interfaces will be kept at least at first; especially IComponent as it is used throughout the code.
Maintenance of the code will be that much easier (modify one function instead of 2-3).
I believe this will make the design much easier to understand for new developers.
'''Development:'''
A separate branch will be created for this development, and kept merged with the running trunk to try to keep things up to date.
The text was updated successfully, but these errors were encountered:
Original Reporter: @jzikovsky
Original Owner: @jzikovsky
This is a fairly large refactoring of the Geometry project, with the purpose of simplifying the class hierarchy significantly by folding in Parameterized versions of all the Components into a single class.
'''The design is currently this:'''
This would not be so bad if there were only Component that needed parametrized version. However, EVERY class in the instrument needs its equivalent Par... version.
This THEN means that there needs to be an IComponent interface to interface between ParametrizedComponent and Component. So for each 1 REAL class, there are 2 MORE classes; triple the complexity!
This is then multiplied by all the classes that have their corresponding ParXXX and IXXX versions:
'''My proposed design:'''
'''Advantages:'''
'''Development:'''
The text was updated successfully, but these errors were encountered: