dimanche 14 février 2016

Design Pattern in node.js

I am trying to solve a problem, where on a certain condition for example, when a student applies for a job, I want the company as well as the college to get notified about this scenario. I have 3 files, students.js,company.js as well as college.js. Now trying to keep up with SRP principle, I would like to create a method in company.js and college.js to handle the condition ( Could this be done using event emitters, where a student raises the event, and the company and college subscribes to the event) or is there a better way to solve this scenario? I am from a C#, .NET background where we could use the observer pattern for this, just wanted to know if there is something similar in node.js

Aucun commentaire:

Enregistrer un commentaire