admin 管理员组

文章数量: 1184232

I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together.

Is it like this:

Nodejs is a webserver, backbone is just a framework that will run on nodejs?

SocketIO is a library that works with backbone then?

And the actual code can be written in coffescript, which when compiled, will be javascript.

What about express then? Could this be used.

Please point out if these are components/frameworks that don't work together etc.

I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together.

Is it like this:

Nodejs is a webserver, backbone is just a framework that will run on nodejs?

SocketIO is a library that works with backbone then?

And the actual code can be written in coffescript, which when compiled, will be javascript.

What about express then? Could this be used.

Please point out if these are components/frameworks that don't work together etc.

Share Improve this question asked Oct 5, 2011 at 13:24 codecompletingcodecompleting 9,61113 gold badges64 silver badges103 bronze badges 0
Add a comment  | 

5 Answers 5

Reset to default 14

Yes, CoffeeScript will work with Node.js without problem. In fact, if you you use the default coffee executable, it is Node.js and you don't even need to compile to JavaScript in order to run it.

As for Backbone, it is really a client-side library. You can also use CoffeeScript here, but you need to compile the code to JavaScript since the browsers only know JS. You wouldn't typically run Backbone.js in Node.

As for Express, it is a Node framework, so it is expected to work on the server in Node.js.

So, in summary:

  • You'd use Node server-side with SocketIO and Express
  • CoffeScript can go client and server
  • You would use Backbone on the client
  • You would likely use a Backbone.sync mechanism for talking from Backbone models to SocketIO on the server

Does that help?

Node.js is a server side implementation of javascript.

Express is a web framework that sits on top of connect, another nodejs module.

CoffeeScript can be installed as a module to node.js that allows you to execute coffeescript code directly in node.js.

Backbone is a client-side browser library that has nothing to do with node.js and can be used with any server-side web framework.

I know nothing about backbone but zappa (http://zappajs.org/) is the sample of coffeescript + express + SocketIO.

Yep, infact here is a great article showing how you can reuse your backbone.js models on the backend.

http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/

I'm not sure what "express" is, but everything else you've mentioned plays well together.

there's a project to replace the Backbone.Sync code (which is what does all of the calls to the back-end server in Backbone) with an implementation that uses Socket.io: https://github.com/logicalparadox/backbone.iobind

a lot of people write backbone code in coffeescript. you'll find a lot of examples of that around the web, including here on stackoverflow.

hope that helps.

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)