On 2010-12-20 10:07 icarusfactor wrote:
>
> Thanks for the tips, got it migrated, I like all the options generate.py
> offers. I did the lint option and it said :
>
> /home/factor/src/qooxdoo-1.3-sdk/tool/bin/question3dview/source/class/question3dview/Application.js
> (248,27): Protected data field in 'this._tableModel'. Protected data fields
> are deprecated. Better use private fields in combination with getter and
> setter methods.
>>>> Done
>
>
> Where is a good demo of private data fields with "getter" and "setter"
> located in the demos?
I don't know if there is any demo, but what has to be done is fairly simple:
1. Make the protected variable private
(_tableModel => __tableModel)
2. Add two methods: getTableModel() and setTableModel(tableModel)
3. Replace any access to the former protected member outside the class
definitions by the according getter/setter method.
Normally only in derived classes.
In your case points 1 & 2 will become something like:
<pre class='javascript'>
__tableModel : null,
getTableModel : function () {
return this.__tableModel;
},
setTableModel : function (tableModel) {
this.__tableModel = tableModel;
}
</pre>
/Peter
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel