For those unfamiliar with the SOLID principles you can start reading here: Wikipedia article. However, most of my understanding comes from: http://www.objectmentor.com/resources/publishedArticles.htmlRegardless, it seems that every GUI interface I run into in Java (even the one in Adobe Flex honestly) is filled with dozens of methods which are duplicated across many classes. Deep inheritance hierarchies are the norm and composition is definitely not preferred over inheritance. This seems to be a clear violation of SRP and ISP.What I would like to know is, am I correct in thinking that these frameworks are violating the SOLID design principles? If so, then why?Response to SnowmanI have to disagree that SWING is an example of SOLID. Lets use the JButton example:1) SRP: The method isDoubleBuffered goes beyond the responsibility of JButton to represent a UI button. That method represents an implementation detail that has nothing to do with abstract concept of a UI button.2) OCP: If I want to change how JButton handles events I have to replace the JButton class completely.3) LSP: The implementation of JButton cannot be readily substituted with other implementations. JButton inherits most of it's implementation details directly. If I want to change the way a JButton creates tooltips, assigns action listeners, or access the graphics context, I have to throw away all of SWING. I cannot simply drop in a new class that handles those things since JButton inherits directly from JComponent.4) ISP: The JButton public interface is littered with dozons of methods from every class that it inherits from. It is litterally a dumping group of public methods from JComponent, Container, Compound, etc. If the interface of JButton adhered to ISP there would only be 10 or so publically exposed methods.5) DIP: JButton publicly exposes methods of it's concrete implementation details. If it applied true dependancy inversion then things like icon's, layout, event handling, etc would be delegated to separate classes that the user could readily switch out to achieve new functionality.
Does having many duplicated methods and deep inheritance hierarchies in GUI APIs (Java Swing, Android SDK) violate the SOLID design principles?
android;user interface;solid;swing;ooad