For example in classic object oriented programming I might have a class School which has an array of String representing students (not the ideal data structure but for illustration purposes only). It might look something like this
class School {
String name;
String[] students;
}
I could then instantiate a bunch of different schools each with a different name and different students. How does this concept translate across to Node.js? If I had a School module than a single instance is shared across the entire application. My initial thought is to represent each school as JSON object and basically pass around JSON where I would normally be passing around an instance of School. Is this the right idea and are there alternative approaches?
constructors and instances: