4 ms·
Well, you really picked the worst representative with awt/swing. I'd say Qt or even classic VB6/Delphi are great examples for OOP gui development.
by iforgotpassword 6y ago
Well, you really picked the worst representative with awt/swing. I'd say Qt or even classic VB6/Delphi are great examples for OOP gui development.
- MaxBarraclough 6y agoHow about JavaFX? Swing has been old hat for years now.
- iforgotpassword 6y agoI haven't touched java gui code in almost a decade, but didn't they suddenly pull a 180 on JavaFX a few years ago?
- MaxBarraclough 6y agoNot exactly, they moved it out of the core Java standard library. The main effect of this seems to have been that many developers are now uncertain of whether JavaFX can be relied on, but it is still maintained.
- astrange 6y agoCocoa has been a great OOP-based UI framework forever. The key is that it doesn't use inheritance and has messaging (https://wiki.c2.com/?AlternateHardAndSoftLayers https://wiki.c2.com/?AlternateHardAndSoftLayers).
- jcelerier 6y ago> The key is that it doesn't use inheritance Cocoa is literally based on inheriting from NSView (which itself inherits from NSResponder) https://developer.apple.com/documentation/appkit/nsview https://developer.apple.com/documentation/appkit/nsview
- astrange 6y agoThat's if you want to make a custom view, which very often you don't. Placing default views in a window and receiving events/values from them doesn't use inheritance, instead using composition and delegate patterns. UIKit lost some of the convenience features like bindings when it shrunk to fit on phones, which might be why people got annoyed enough to invent entirely new UI frameworks.
- jcelerier 6y ago> That's if you want to make a custom view, which very often you don't. I have never seen any non-trivial software not have custom-drawn widgets - grepping for `: NSView` in my ~ gives me a few thousand matches (and it's not even a mac) > Placing default views in a window and receiving events/values from them doesn't use inheritance, instead using composition and delegate patterns. ... but you can't have composition without at least interface inheritance, and in this case you really want access to the parent methods & properties of NSView when creating your own widgets (e.g. bounds, rects, tooltips, etc) so you also want implementation inheritance.