-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Network: Improve option handling #3060
Comments
@wimrijnders do you except this to affect the nodesHandler option handling too? If so it will affect public APIs and probably should be flagged with that ? |
@rasmusblockzero Yes, I expect it to affect all option handling within |
one possibility Prototype chainingThe various option groups are kept separate and linked to each other via the prototype construction inherent to javascript. For a given node (edge comparable), the chain would be:
...for every node in a network. The chaining can be done with existing function PROS
CONS
Further Considerations
|
possibility two Copying/merging/flatteningInstead of chaining the values can be copied/merged each time update comes so that the node's this.options is a complete representation of the values. Comparing to the current code, it would make the implementation more similar to the PROS
CONS
Further considerations
|
third possibility NOTE: This approach is not incompatible with the first option Separate Options classA E.g. PROS:
CONS:
|
fourth possibility Make checks more explicit at each place it's usedA more simple approach, make all options available through out the process so for each place in the draw there has to be if cases for if the value exist in any of the levels PROS:
CONS:
|
@wimrijnders I don't think the public API need to change but the outcome of certain actions might change, right? It will not be backward compatible in a strict sense. Even if I think it's better and I think that all applications can adapt to these changes shouldn't that better be flagged? |
@wimrijnders I don't understand "If you don't mind doing the extra work, you can also move over the the text for options Copying/merging/flattening, Separate Options class and Make checks more explicit at each place it's used to each of these comments." |
@rasmusblockzero That was a way of asking you to do the text copies, in a polite manner. Which you did, so thank you! 😄 |
Yes, definitely. In practice, this means that at least the MINOR-release version will go up. |
right
…On 22 May 2017 at 08:45, wimrijnders ***@***.***> wrote:
I don't think the public API need to change but the outcome of certain
actions might change, right?... shouldn't that better be flagged?
Yes, definitely. In practice, this means that at least the MINOR-release
version will go up.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3060 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ASqgQ7NGn-0ppZu7vAdJ7nu5NrB9uYiPks5r8S7zgaJpZM4Nd8pg>
.
--
------------------------------
Rasmus Hedin
CTO and CoFounder
Block Zero
+46706066776
rasmus@blockzero.se
|
@rasmusblockzero I just added following in the prototype chain comment:
It appears that my largest worry (chaining of option members) is unfounded. This is good news; it means that full prototype chaining is easier than I thought. |
Yes, Sorry. I could have explained that better that is what my understanding was too. Are you then set on using the chaining? There might be a hybrid between chaining and separate class structure:
|
It's not a hard target. I just think it's the most elegant solution.
👍 I have no problem with this at all. It is, in fact, a good idea. |
@rasmusblockzero Take a look at
This looks suspiciously like flattening, i.e. option 2 above. Do you agree? The result is used to initialize |
I believe that this is connected to the built in configurator only I think the deepExtend is a recursive copying function yes, but not flattening. The configurator is cool, it's a bit odd to have it built into the framework IMO but I can totally see the point of if. |
The conclusions of this thread:
This will be the driving principle for further work on the options. In general, this means cleaning up the code breaking the prototyping principle and see if this can be modified to smart properties. @rasmusblockzero, thanks for your input here! |
This issue has been created to discuss the improvement of the option handling for
network
. The option handling is complex and diffuse, multiple methods of handling options are intertwined. This can use a thorough cleanup to make it more manageable.The following comments collects notes from a discussion in the lobby between @rasmusblockzero and self.
The text was updated successfully, but these errors were encountered: