I have a web application that uses the Backbone.js framework (which is prototype-based). However, there is object oriented code that isn’t Backbone.js code. My question is: How can I document the application modeling with UML if not all of the code is object-oriented?
How can i model a style prototype-based and combine it with OO? Is it possible and/or correct? Can anyone point me to some documentation?
I have a web application that uses the Backbone.js framework (which is prototype-based). However,
Share
You could argue that as long as you simply use the
*.extend({...})style class definitions in Backbone, then your Backbone class model will be a standard. object oriented class model.Consider:
While it’s true that internally Backbone uses prototypal inheritance chaining, no “prototypal characteristics” are being employed here. The
extendfunction does not modify existing object’s prototype, and unless you later on monkey patch a superclass prototype, the with something likeViewBase.prototype.something = 'foo', the superclass prototype will be unchanged throughout the application’s lifetime.What’s missing of course are private/protected properties, but otherwise the Backbone class model is no different from, say, Java or C#, so I don’t see why a standard UML class diagram would not be able to describe it?