Refactor server code #38

Open
opened 2015-01-19 22:01:09 +01:00 by kjetil · 2 comments
kjetil commented 2015-01-19 22:01:09 +01:00 (Migrated from gitlab.lallis.org)

Having a separate file for Meteor.methods definitions that mostly will just call functions in other files is kind of pointless.

It is also very stupid to make all the functions we need to call live in the global, top-level namespace.

A better approach would be to put the Meteor.method definitions in the apropriate file in the server folder, and stop defining the functions using this.*

This way the actual functions will be "private" and the methods will be exposed through Meteor.methods. Any functions that are called across files (very few) should at least get their own namespace to prevent polluting the root namespace.

Having a separate file for Meteor.methods definitions that mostly will just call functions in other files is kind of pointless. It is also very stupid to make all the functions we need to call live in the global, top-level namespace. A better approach would be to put the Meteor.method definitions in the apropriate file in the server folder, and stop defining the functions using this.* This way the actual functions will be "private" and the methods will be exposed through Meteor.methods. Any functions that are called across files (very few) should at least get their own namespace to prevent polluting the root namespace.
kjetil commented 2019-09-18 22:21:18 +02:00 (Migrated from gitlab.lallis.org)

mentioned in commit 3adf0d51f7

mentioned in commit 3adf0d51f7284c317ae18432edf18e412f912cc5
kjetil commented 2019-09-18 22:21:18 +02:00 (Migrated from gitlab.lallis.org)

mentioned in commit 153f6d0421

mentioned in commit 153f6d04218e58616dc8adaaa2a3d8fb0c606031
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kjetil/predi#38
No description provided.