I'm starting a Geographical map application in Js which will handle hundreds, maybe thousands of 3 different types of elements. I'm considering MVC approach but I don't know how would be the best way of implementing it and even if it is the best decision. What I have in mind is:

  • Views: one per object, will live in the Frontend
  • Controller: will have 3 (one per element type) and each one will hold a list referencing all the existing views. Will live in the Frontend
  • Model: not sure if should live in backend or there should be a copy in the Frontend as well.
  • Orchestrator: will initialise and orchestrate the Controllers

I've been searching a lot on the web an all the examples I can find relate to just one View per Controller and where the term View means HTML Views(i.e.: divs, forms, etc), so my specific questions is:

How to handle multiple non-HTML Views in MVC?

And maybe some guidance/literature/examples (not necessarily in Javascript) supporting it


  • How do you handle one? – Robert Harvey Nov 10 at 12:26
  • I'm a bit confused as to the reasoning here. You don't know how to approach it, or whether this is a good approach; but you've already decided to do it anyway? It's hard to look for the best option when dealing with unfounded immovable decisions. – Flater Nov 10 at 12:48
  • It's also unclear what you mean by "non-HTML view". If you mean a REST API response (e.g. JSON), that's just not MVC then. That's an api controller with a mapped dto response. – Flater Nov 10 at 12:49
  • @Flater I've updated the description of the question, should be clearer now. As for the non-HTML View I mean a custom class to handle: graphical elements of one entity (Maps polygons, polylines, etc), listeners and some basic state. – bermick Nov 10 at 13:01
  • @bermick: But to what does it map? If it's a view, it should be an HTML response. Describing it as non-HTML indicates that it's not a view to begin with. – Flater Nov 10 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.