Sometime right way - not easy way. For sample, http://guides.sproutcore.com/html_based.html. Easy? Da. Right? Nyet.
I let son Alexei splain how comrades wycats and tomdale go wrong. Not chernobyl wrong, but slightly wrong.
Dad says:
The new "Todos" sample app in the guide, lacks the functionality that makes SproutCore so powerful in an attempt to make it "easier' to use. The new Todos app is not the in the spirit of SproutCore's, "How do we build blazingly fast, desktop-class web applications?", a desktop-class web application.
This is not meant to be a criticism of the handlebars approach. It is a much more intuitive approach to building a view than the context push/pop approach. Rather than creating an oblong wheel (doesn't translate literally well), where the handlebars todos app lacks functionality that the regular todos tutorial app has (ie inline editing, cursor navigation), a TemplateView item could be added that enhances the functionality and plugs into the existing app.
Alexei
Da Alexei, Spasiba. Please constructive criticism only.
Comrade Mikail Cliftov
Secretary General,
Secret Operation Branch
I think you're missing the fact that this new functionality does not in any way replace the existing functionality. It merely provides another way of doing things. TemplateView isn't for everyone and that's ok.
ReplyDeleteHow I think I'm currently thinking about the TemplateView is that it doesn't remove functionality at all, but adds another layer of abstraction. The handlebars template is just an object that the view delegates to in order to render itself.
ReplyDeleteI don't think that the tutorial that you mentioned is not really trying to show showcase the template view as much as to say that you don't have to use the full Sproutcore stack in order to benefit from Sproutcore. In my mind that tutorial is meant to show that Sproutcore can do what Backbone.js does for the little(r) things as well as handling the bigger things.
So I guess I disagree :)
Comrade Cliftov,
ReplyDeleteI agree with you, which means I think you misunderstand our reasoning behind introducing these features.
You're right when you say that the easy way is not always the right way. Unfortunately, humans tend to make choices that maximize short-term rewards. Our experience was that many people were choosing lighter weight frameworks because they did not anticipate their web app growing beyond a certain level of complexity. By the time they realized that they had outgrown their framework, they had already made a significant engineering investment.
We want developers to be able to use SproutCore for what they perceive to be simple apps. If they ever outgrow SC.TemplateView, they will have an easy on-ramp to using SproutCore's robust view layer. And, importantly, they will be able to use their existing templates as they migrate over to desktop-style views.
Handlebars template views are not meant as a replacement for SC.View and our rich library of controls. They are designed to integrate with existing applications . As always, it's important to pick the right tool for the job. We're just giving you one more tool.