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

feat!: Redesigned the way functions are resolved #76

Merged
merged 10 commits into from
Mar 18, 2022

Conversation

thygesteffensen
Copy link
Member

@thygesteffensen thygesteffensen commented Feb 28, 2022

Draft pull request to discuss #47 and #59

This is a draft of the solution to solve the related keywords and is meant to open a discussion of the possible solution(s).

Design choices:
Why didn't you have an alias list instead: Having a metadata class with a list instead of a string seems simpler. However, it is difficult to extend the list and easier to just add a new metadata object. In general, there will not be more resolving related to function than the previous solution, but the new solution makes it possible (and easy) for users to add aliases, i.e. multiple metadata registrations can register for the same class, with the same function name.

It's still possible to overwrite functions by registering a new metadata class, after the one You want to overwrite. (The resolved list is in chronological order)

FunctionMetadata.cs have been added to make it easier to add function aliases and make the function part lighter.
Added FunctionMetadata.cs makes it possible to register a function on multiple aliases. Furthermore, only the FunctionMetadata class is retrieved as a list from DI, thus not building the function before it is actually needed, making room for more heavy dependencies, without making the entire engine slow.

Resolved #47, Resolved #58. Still need to clean up.
@thygesteffensen thygesteffensen merged commit d9d614b into dev Mar 18, 2022
@thygesteffensen thygesteffensen deleted the tst/metadata-function-reg branch March 18, 2022 14:17
@github-actions
Copy link

🎉 This PR is included in version 4.0.0-dev.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Feature : Alias Map Replace IEnumerable<IFunction> to IEnumerable<FunctionMetaData> instead
1 participant