Replaced fixed order with dynamic ordering#286
Open
bmomberger-bitovi wants to merge 1 commit intomasterfrom
Open
Replaced fixed order with dynamic ordering#286bmomberger-bitovi wants to merge 1 commit intomasterfrom
bmomberger-bitovi wants to merge 1 commit intomasterfrom
Conversation
Contributor
|
the behaviors shouldn't know about each other, this seems to create that situation? |
Contributor
|
The idea behind can-interface is the dependencies should be on the method/property instead of a module. |
Contributor
Author
|
What problem is solved by behaviors not knowing about each other? |
Contributor
|
Other implementations of those behaviors can be provided.
…Sent from my iPhone
On May 3, 2017, at 11:43 PM, Brad Momberger ***@***.***> wrote:
What problem is solved by behaviors not knowing about each other?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Contributor
Author
|
That doesn't change if behaviors reference each other by key as this PR does. Reimplement with same key => order preserved (by the list in existing code; by the inbound deps in this PR); Reimplement with different key => order can be determined by mutating |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #271, the automatic addition of
data/callbackswhen thereal-timebehavior is used, was a desired feature of can-connect, and necessitated some way for real-time to declare that it needed another package included while still preserving order. this changes the ordering code so individual behaviors can decide where in the order they should go, and allows other connect behavior authors access to this ordering.This isn't quite ready yet, because the dependency objects are generally rather ham-handed, mostly deriving from the lines of order previously listed in connect.js plus some trial and error. Also tests have not yet been made for the new ordering code and for required deps.
Pursuant to the previous bullet point, a pain point about can-connect (that the dependencies between behaviors aren't clear from the docs or code, due to the relationship between behaviors stems from shared property names) can be somewhat remedied by using the dependency object to show where ordering must be enforced.
The dependency from one behavior to another may be in either the "base" direction (from object to proto) or the "derived" direction (from proto to containing object), and may be "optional" (enforce order if both behaviors are included) or "required" (if A is included then include B in the correct order).