Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8997 closed feature (wontfix)

Implementation of private methods

Reported by: sievlev Owned by:
Priority: minor Milestone: none
Component: ui.widget Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:


In current implementation of widgets it's easy to accidentally overload an internal methods.

For example, I can create an own _createButtons() method in my widget inherited from $.ui.dialog. As a result I will corrupt internal routines in $.ui.dialog widget.

I suggest to implement a real private methods to avoid possible conflicts. For simplicity reasons I suggest to expand naming conventions. Like in python or glibc all methods started with two underscore symbols will be treated as a private methods. To call a private method you will have to use a special call similar to _super.

See for details.

Change History (3)

comment:1 Changed 9 years ago by Scott González

Component: ui.coreui.widget
Resolution: wontfix
Status: newclosed

This isn't going to happen. Everything is exposed and we like it that way.

comment:2 Changed 9 years ago by sievlev

So I can safely override the undocumented methods and use them in any way, isn't it?

As I understand you I can have an own version of _createButtons in my dialog?

comment:3 Changed 9 years ago by Jörn Zaefferer

No you can't. Our widgets are generally not designed for inheritance, so if you extend something, you have to know what you're doing. There are a few exceptions like the _renderItem method in autocomplete, which is specifically intended for overriding. There is definitely more work to be done on documentation:

Note: See TracTickets for help on using tickets.