Researches

Inheritance:
http://ejohn.org/blog/simple-javascript-inheritance/

Private variables with that method:

@Lars

You can make private variables in the init method, for example. You just need to make getters and setters as well, i.e.

init: function() {   // Private var   var _div = $( div );   // Priviledged method accesses private var   this.getDiv = function () { return _div; }   this.setDiv = function (div) { _div = div; }   // other initialization stuff }

Downside is that the privileged getters and setters can’t be put in the prototype, i.e. they are created for each instance separately. Another issue is the overhead of closures in general.

Interesting Information about extending prototypes:
http://blog.dreasgrech.com/2009/11/no-one-should-extend-objectprototype-in.html

Reading files with javascript:
http://msdn.microsoft.com/library/windows/apps/hh464978

javascript private scope, maybe a good read:
http://www.bennadel.com/blog/2269-Creating-A-Private-Scope-By-Extending-The-Public-THIS-Scope-In-JavaScript.htm

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s