Currently, the term interface in Synapse lingo refers to, more specifically, the set/getHandler for DOM elements. Interfaces are now intended to refer to classes which all contain a common API for interfacing with one another including:
bind, unbind, and trigger - the typical event methods common to Backbone.Events and jQuery/Zepto
observe, unobserve, and sync - the primary methods for setting up a one-way or two-way binding
get and set - common API for getting/setting data for the underlying object (regardless of the type)
The hierarchy would look something like this:
Interface (default)
ElementInterface - for interfacing with single DOM elements (no child nodes)
FragmentInterface - for interfacing with a DOM element's child nodes
ViewInterface - for Backbone.View instances, uses either ElementInterface or FragmentInterface internally
ModelInterface - for Backbone.Model instances
CollectionInterface - for Backbone.Collection instances
Each of these classes would have the above defined APIs for trivially interfacing with one another and it provides a mechanism for supporting additional types of objects from other libraries (e.g. Dojo, Spine, etc.)
Currently, the term interface in Synapse lingo refers to, more specifically, the
set/getHandler
for DOM elements. Interfaces are now intended to refer to classes which all contain a common API for interfacing with one another including:bind
,unbind
, andtrigger
- the typical event methods common toBackbone.Events
and jQuery/Zeptoobserve
,unobserve
, andsync
- the primary methods for setting up a one-way or two-way bindingget
andset
- common API for getting/setting data for the underlying object (regardless of the type)The hierarchy would look something like this:
Interface
(default)ElementInterface
- for interfacing with single DOM elements (no child nodes)FragmentInterface
- for interfacing with a DOM element's child nodesViewInterface
- forBackbone.View
instances, uses eitherElementInterface
orFragmentInterface
internallyModelInterface
- forBackbone.Model
instancesCollectionInterface
- forBackbone.Collection
instancesEach of these classes would have the above defined APIs for trivially interfacing with one another and it provides a mechanism for supporting additional types of objects from other libraries (e.g. Dojo, Spine, etc.)