4 ms·
GWT has done the "run the same code on either client or server" for years now (2006) and, IMO, it's not a silver bullet. Beyond trivial validations (not null,
by stephen 15y ago
GWT has done the "run the same code on either client or server" for years now (2006) and, IMO, it's not a silver bullet.
Beyond trivial validations (not null, length check), most of interesting the business logic you run on the server assumes server resources. E.g. a chatty/optimized db connection, or a wire call to some backend service that the client can't make directly.
Maybe something magical about JavaScript/node.js will make "write once, run anymore" actually happen this time, but history isn't in its favor.
Don't get me wrong, it is nice, for some formatting, validation, etc. purposes. I just don't see server-side-only code going away anytime soon. (Which I'm sure is not what they're saying, I'm just musing here.)
- mseebach 15y agoI think the domain of validations that are independent of server resources is larger that you express. There's the whole "consistency" check - if X is checked, Y and Z must be filled out etc. Also, check-digit checks on values such as ISINs[1] (real-life example). 1: http://en.wikipedia.org/wiki/International_Securities_Identification_Number#ISIN_Calculation_Methodology http://en.wikipedia.org/wiki/International_Securities_Identi...
- i5ao 15y agoMojito doesn't try to be "write-once run-anywhere." It doesn't provide any UI or device abstraction layers by itself, beyond what YUI has always done. It's an MVC app framework, oriented towards composing modules/widgets-- aka mojits. If you want to render your stuff server-side, you can. If you change your mind, it's a pretty trivial change-- and in fact you could do it at runtime (Yahoo has a search product in beta that does this after instrumenting the connection/device speeds). There will always be server-side only stuff, but at least you don't need to switch languages or frameworks when you decide what to do where. A sweet spot might be an online/offline HTML5 app that uses YQL or other webservices, for which you want to provide desktop, tablet, and smartphone versions and/or native versions via phonegap or similar. That said it's definitely not for everyone, and it's still a very young project. (disclaimer: I work at Yahoo)