Newbie asking design questions for a project

23 views
Skip to first unread message

Hanumant Singh

unread,
Jul 24, 2015, 8:37:10 AM7/24/15
to nodejs
Hi

I am new to node js. I am currently trying to work on a project where a node js server can provide n different functionalities.
I envision each of these functionalities as a separate module,for eg music control, task list manager etc.
A command will be received by the server.
This command could be handled by any of the possible n modules/functionalities..
The server has to identify which module can handle it, and dispatch it.

1) Am i correct to implement each of the different unrelated functionalities as separate modules that the server requires
2) Each of the functionalities can support n different commands for eg, music control can support play music, pause music etc.
2) I believe the different supported commands can be accessed through exports attribute of a module, however mapping an incoming command to the correct module is a challenge.

I am not sure if such use cases already have elegant solutions in nodejs.
Off the top of my head I can think of some sort of hash computation (if there is nodejs support for it) on the supported commands of a module for faster access.

Thank you for your help.

Hanumant

Reply all
Reply to author
Forward
0 new messages