Skip to content

ENH - put toolbox extraparameter handling in specific classes #311

Description

@AljenU

Currently, in aas_inittoolbox there is a parsing of toolbox extraparameters. This assumes that the extraparameters for different toolboxes can be handled the same, whereas this is something that is actually quite specific for a particular toolbox. I.e. that if there are colons in the value, then that value should be split.

Since the extraparameters are specific for a particular toolbox, it makes more sense to put the handling of these parameters as a static method in the specific toolbox class. That also makes it more clear which toolboxes have known extraparameters.

The toolboxClass they all derive from would define a do-nothing default method, or even no method at all, since the method will only be called for classes that expect extraparameters.

In aas_inittoolbox it could then look something like

        params = {};
        if isfield(TBX,'extraparameters') && ~isempty(TBX.extraparameters)
            parse_extra = str2func([tbxname 'Class.parseExtraParameters']);
            params = parse_extra(TBX.extraparameters);
        end

        constr = str2func([tbxname 'Class']); 
        T = constr(TBX.dir,params{:});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions