< QmlWeb‎ | Qml.js
Revision as of 17:24, 10 February 2015 by Akreuzkamp (talk | contribs) (Created page with "This page intends to collect questions about software architecute and software design, pros and cons as well as the decisions made on the topic. ==Runtime Architecture== ===G...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

QmlWeb/Qml.js/Design Questions and Decisions

This page intends to collect questions about software architecute and software design, pros and cons as well as the decisions made on the topic.

Runtime Architecture

Getter/Setter Technique

Possibilities:

C++ style getters and setters
this.width(); and this.setWidth(width);
  • C++ style
  • fast in all browsers
Transparent getter/setter using Object.defineProperty
Object.defineProperty(this, "width", { get function(){}, set: function(){} });
  • nice while debugging
  • worse performance in IE
  • horrible performance in Firefox
Transparent getter/setter using literal notation
  • nice while debugging
  • worse performance in IE


Benchmark: http://jsperf.com/getter-setter/7

Decision: Use transparent getter/setter using lieral notation.


This page was last edited on 14 March 2015, at 15:37. Content is available under Creative Commons License SA 4.0 unless otherwise noted.