Default ROMSComponent
instance / lack of substitutability
#116
Labels
design
top-level design question
ROMSComponent
instance / lack of substitutability
#116
As mentioned in #115 , the design of
Component
reflects the needs of many earth subsystem models:In the
Component
base class, with the exception of the base model, those from this list (that are defined, see #115) are listed as Optional. We can easily imagine a Component not needing one or many of these things.For instance, we would anticipate only rarely needing additional source code files. This was in fact only added to alpha because of ROMS' need for it. This presents an issue: for ROMS, Additional source code files are required for any reasonable level of control over the model, including switching entire model subsystems on or off. Thus, for the
ROMSComponent
subclass, these are NOT optional.This violates the Liskov substitution principle, as we have an optional attribute on the base class that is required in a subclass.
I believe the best remedy here would be to also make these optional in the subclass, set a default value, and raise a warning that the default value has been invoked.
This means we should have a "default" ROMS component that is initialised if you just call
ROMSComponent(base_model = some_version_of_roms)
with no other arguments.The text was updated successfully, but these errors were encountered: