I work a lot more with JavaScript in node.js. My application has the following general βclassesβ that are used.
Server side:
- Libraries
- Models
- Utilities
- Routes
Client side (backbone.js):
- representation
- Models
- Collections
The client side is pretty straightforward. I name all the files related to what they are, such as UserModel.js, UserView.js, UserCollection.js, etc.
However, the server side becomes more dirty. For instance:
Models are associated with MongoDB collections. Each model is simply a shell for various functions. If I have a collection of users, I have a collection called users, my model Users.js.
, , Users.js, .
users, , .
URL. , /account/, account.js - .
. util.js, , , .
, , "", /.