-
Notifications
You must be signed in to change notification settings - Fork 24
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
Design Decisions #14
Comments
Default ValueIIRC Magic stringI don't like "magic strings", but I agree the dependency for marking interface to the feature can be cumbersome. I already had in mind to provide an alternative to be able to use any class as a feature. One can easily add support for any class as a feature. I can imagine that one could provide support for magic strings in a separate library, which can reuse the feature configuration functionality but only use the configured behaviours out of it. However even the I hope I could answer your questions. |
Default ValueWhen I implemented the VstsConfigration I looked how the AwsConnfuguration was implemented. The method is a nulablle bool
And there was not method for passing down default values to the configuration store implementation. Magic stringsDo you use the classes for anything elese then naming the features? Maybe I'm missing some advantage here. |
Default ValueAh, I got your confusion. You could have multiple layers of behaviour, what I usually have is the following chain:
All of the behaviours except of the default value behaviour only return a proper Magic stringsUsually the functionality I want to toggle is provided by some class, I tag this type with the interface. About your former question, if you have to use the same feature in UI and Data logic. |
I wanted to discuss two design decisions:
Default Value
I’m not happy with the nullable boolean that is returned from the
Is().Enabled
method. This leaves a lot of complexity to the client. I would prefer a way to add a default value that is returned instead of null. Something like
Is().Enabled.WithDefault(true)
This would leave the old way like it is but also enable default values.
Add “magic string” alternative to class
I normally do not add any logic to my feature class. The class for me is only an overhead that makes me deal with dependencies. If I use the same feature in UI and Data logic this can be a problem. It also is code I have to maintain. I really would like a string alternative:
Feature.ByName("ma-magic-string").Is.Enabled
I’m interested what you think about it.
Maybe I just use the framework other than you do.
The text was updated successfully, but these errors were encountered: