You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the binding space, including whether BinderBase<T>, IValueSource, and IValueDescriptor are needed in the public API for usage beyond SetHandler#1918
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.
namespaceSystem.CommandLine.Binding{// This is the only hit of BinderBase in this proposal. Is it needed?// The "Base" suffix is recommended against unless it's a very niche carve-out from a class that uses the better name.// Basically, if more than 30 people in the whole would would ever need to write it in their code you need a better name.publicabstractclassBinderBase<T>:IValueDescriptor<T>,IValueDescriptor,IValueSource{protectedTGetBoundValue(BindingContextbindingContext);}// In general, interfaces should only define capabilities, not actual structure.// If at all possible, this should be turned into an abstract class.// Note that interfaces can basically never change (we have never successfully added a DIM as a way to expan an interface).// So with this interface there's no proven way to add, e.g. T GetDefaultValue<T>(Func<T> defaultValue) in a later version// in a way that avoids boxing values into object.publicinterfaceIValueDescriptor{boolHasDefaultValue{get;}stringValueName{get;}TypeValueType{get;}objectGetDefaultValue();}// Interfaces with no members are effectively prohibited.publicinterfaceIValueDescriptor<outT>:IValueDescriptor{}// This doesn't look like a capability, so a base class is very strongly preferred over an interface.// (We really don't like interfaces)publicinterfaceIValueSource{// We really don't like ref. Is this actually C#'s `out`?boolTryGetValue(IValueDescriptorvalueDescriptor,BindingContextbindingContext,refobject&boundValue);}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: