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

Clean up the namespace managers' implementations #142

Open
thunder-hammer opened this issue Jun 2, 2021 · 2 comments
Open

Clean up the namespace managers' implementations #142

thunder-hammer opened this issue Jun 2, 2021 · 2 comments

Comments

@thunder-hammer
Copy link
Collaborator

thunder-hammer commented Jun 2, 2021

Currently the namespace managers are somewhat confusingly implemented.

  • They use static methods that are difficult to override but the EdifNamespace and DefaultNamespace share most of the same code.
  • The class that inherits from the callback class to implement the callback portion is created in __init__.py

There are some things that could be easily refactored to help future contributors and make maintaining the namespace managers much easier. Some suggestions:

  • Convert all the static methods to class methods. These appear to be easier to override in an inheriting class.
  • Break the callback override out of the __init__.py (this would just make finding everything easier)
  • Make the EdifNamespace class inherit from the DefaultNamespace class.

I think with these clean ups the namespace manager could be come a better example of how to implement a plugin using the callback framework.

@thunder-hammer
Copy link
Collaborator Author

Just made the static methods class methods.

Then I made the EdifNamespace inherit from the default namespace and removed unchanged methods.

@thunder-hammer thunder-hammer self-assigned this Jun 2, 2021
@thunder-hammer
Copy link
Collaborator Author

The inheritance could be further cleaned up by replacing large sections of logic with calls to super()

@thunder-hammer thunder-hammer added this to Work in progress (for the current release) in Ideas for future releases Jun 7, 2021
@thunder-hammer thunder-hammer moved this from Work in progress (for the current release) to Ideas in Ideas for future releases Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

1 participant