by Ben Combee at the HTML5 Texas Conference in Austin, TX
Enyo (http://enyojs.com) started as an web application framework, focusing on the problem of effectively building reusable UI components. However, many app developers view problems through a Model-View-Controller (MVC) point-of-view where the UI is seen as a templating problem. This talk looks at how the Enyo framework evolved in late 2012 to take on aspects of MVC, integrating support for Backbone models and data binding into our component & message passing architecture. In doing so, it reveals what these two worlds can learn from each other, and how they both play into future work on the “web platform”.
A new way of thinking
How do you keep application state?
Templates are not enough. Interactive controls are hard to put into templates.
UI Plugins are not enough because in application development you have to maintain state and other things that aren’t necessary on the desktop.
The huge advantage of enyo is that it is a fully encapsulated object and can be re-used throughout the application. markup, event handling, logic/state, user state, etc.
You can easily combine and reuse views.
The goal is to never have to touch the HTML and just use components with css applied.
- Components can lead to complexity
- Data isn’t centralizes
- Lots of broilerplate code repeated over and over
- Allows tight or lose coupling of views and controllers
- Allows view-owned-controllers and controller-owned-views
- Introduces the observer pattern, computed properties, the mixin pattern and bindings
- A ton of other cool features, improvements and added versatility
Integration with Backbone
- a controller that knows how to interact with backbone.collection
- a controller that knows how to work with backbone.model
At this point, the talk went into details of how you actually program in Enyo.