Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create KeyValueParamBase abstract base class #25

Open
npetersen2 opened this issue Feb 23, 2019 · 3 comments
Open

Create KeyValueParamBase abstract base class #25

npetersen2 opened this issue Feb 23, 2019 · 3 comments
Assignees
Labels
architecture Defining and implementing system architecture.
Milestone

Comments

@npetersen2
Copy link
Contributor

If we really wanted to be pedantic, we could make an abstract base class called KeyValueParamBase or the equivalent and put this functionality in it. Then all classes that can be initialized using this method can inherit from this base class.

I rather like this idea since many classes seem to have a copy paste of the createProperties() method. Making it part of an interface would enforce classes to have this capability.

If no one opposes, I'll go and do this change.

@npetersen2 npetersen2 added question Further information is requested. new architecture Defining and implementing system architecture. labels Feb 23, 2019
@npetersen2 npetersen2 added this to the Tasks for 2019-02-25 milestone Feb 23, 2019
@elsevers
Copy link
Contributor

That's a great idea! It follows the 'D' in SOLIDD ('D' for DRY code - 'don't repeat yourself') 👍

@npetersen2 npetersen2 self-assigned this Feb 24, 2019
@npetersen2
Copy link
Contributor Author

I'm purposely not going to implement this before the meeting tomorrow, as this will be another reasonably major architecture change.

I would like to resolve some of the PRs into develop first.

At 2019-02-25 meeting, please move this to next week's milestone.

@npetersen2
Copy link
Contributor Author

Make base class that has createProp() method implemented and abstract method for validateProps(). Also make constructor in base class which calls both of these. The child class should call the parent constructor.

Need to change child properties to public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Defining and implementing system architecture.
Projects
None yet
Development

No branches or pull requests

2 participants