-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Setting default value of 'name' in a Parameterized class doesn't work #644
Comments
You shouldn't use the variable
|
I wonder if we could support this by changing Param's code, so that anyone who explicitly declares a |
I agree with your suggestion @jbednar, if But I want to share/discuss something underneath it that is bouncing here in my head: I understand there is a design issue there. Bear with me, ' I know that would probably mean more work, but how about changing ' Does that make sense? |
Sorry if I gave the wrong impression: the name was never enforced or even assumed to be unique; it was only helpful that it was unique so that when the object's name was displayed (e.g. in an error message or as a representation of the object in a GUI) the user could distinguish this object from other objects. What was enforced (and continues to be enforced, even with my proposed change) was that the name exists, so that the object would have some sort of label for use in those purposes. Users were always expected to update the name to something meaningful for them if they wanted the label to be useful, and the meaningful name has never been required to be unique. Given that the name is required to exist, the other reasonable default would have been to give it the name of its class, but doing that would make the visual representation ambiguous by default, which isn't desirable in a GUI context where people need to tell similar objects apart from each other. So there hasn't been any change in this support or behavior (ever); the only difference is that Param has become used much more widely, outside of the context of a small number of heavyweight objects a user might want to manipulate in a GUI context or visually represent in text reports.
I think I gave the wrong impression here, by not making a distinction between the two different ways that I'm proposing that the behavior in (1) be configurable; if people don't want special auto-generated names, there's no reason they should have to have them! Param doesn't require that the names be unique, and people should be able to use any non-unique name they feel like, instead of having to fight Param. Making this change shouldn't affect any other behavior, as it does not change the semantics of Having relaxed (1), it's up to the user what they do about (2). Wherever
To be clear, |
Perfect, I now understand the whole thing. It was my mistake thinking it should be unique. After that, I would say everything is indeed the way it should be. I'm closing this. Thanks. |
I'd still like to address your original concern, namely (no pun intended) that your user-supplied "ze" name was not respected as the default value for this parameter. That's about behavior (1), which I think we can and should change. If a user has specified some particular value for I briefly tried to do that by suppressing the |
ALL software version info
Description of expected behavior and the observed behavior
Setting a default (string) value to Parameterized class'
name
attribute doesn't work (as expected).A given default value is overwritten by an incremental "
Classname<SERIAL>
" value.We can set the/a value later, though.
I was expecting the default value to be used as initial value.
Complete, minimal, self-contained example code that reproduces the issue
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: