Skip to content

Instantly share code, notes, and snippets.

View nlundquist's full-sized avatar

Nils Lundquist nlundquist

  • Bitovi
  • Calgary, AB
View GitHub Profile
@nlundquist
nlundquist / mutual-interface-ordering.txt
Created June 9, 2017 15:02
can-connect behavior mutual interface ordering problem
Mutual Interface Ordering Problem:
Two behaviors (A1, A2) implement the same interface properties. A third interface (B) depends on that interface, but requires being ordered after a specific implementation of A. How can we allow arbitrary insertion order of these behaviors and still end up with the dependency correctly satsified?
For the purpose of the example below B depends on being ordered after A1.
e.g
We should be able run code like:
`
var con = connect();

can-connect behavior changes

  • create behavior bundles
    • adds multiple behaviors at once (as required)
      • concerned that adding behaviors as required will be complicated since we may not just require the presence of a particular attribute, we'll require that particular attribute as implemented by specific behavior

        • e.g real-time doesn't just require just any implementation of the instance callbacks, it will have undefined functionality if it doesn't get the callbacks as implemented by constructor/callbacks-once instead of the constructor/constructor implementation of the callbacks

          • if we start requiring specific behaviors rather than just the interface how do we make these requirements while still allowing users to replace those individual behaviors?