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

Feature/type safe naming #467

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

laviallb
Copy link

Add type safety to registration/resolving.
When registering elements identified by name, we might leave literal strings in the code and/or keep a list of string identifying registered element. But there is not safety in case of changing an element type at registration without updating resolving, or any other way of switching types/string.

This PR adds:

  • TypeIdentifier protocol to associate a type to a string name
  • Identifiable protocol to statically bind a registrable type to aTypeIdentifier
  • DedicatedIdentifier to bind types which can not extend a protocol such as protocols
  • entensions over Container and Resolver to use this type safe identification on top of literal string naming

@laviallb
Copy link
Author

Hello @jakubvano, what do you think about this PR?

@felginep
Copy link

Any update on this ? @yoichitgy maybe ?

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

Successfully merging this pull request may close these issues.

2 participants