On Mon, Apr 4, 2011 at 12:10 PM, Clécio Varjão <[email protected]>wrote:
> One of the most frustrating thing in OO is private methods. Specially > in an "open source" software, I believe there should not be private > methods (or avoided, and use only for essential code- e.g. > manipulating private fields). Protected methods could be used in favor > of private methods, so developers could extended the class. > Any chance of GWT move towards using Public/Protected methods instead > of private methods? > > For instance, it is almost impossible customize Trees, SuggestBox, and > others. And doing a copy-and-paste for a new class, defeats the > purpose of OO. > The basic problem is that defining a protected API is much harder than a public API, as you have to clarify the interactions between all the methods and define which implementation details are exposed to subclasses. Also, you generally wind up constraining the implementation, requiring breaking changes to the protected API to change the implementation. Finally, it is easy to later open up a protected API if it is justified, but it is much harder to remove it. So, in general, we err on the side of locking everything down and then opening it up as warranted. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
