5 ms·
I'm not sure I see any real difference between the DOM and the tree of widgets you can build in Swing. What is it that's so brilliant about the DOM?
by ptx 7y ago
I'm not sure I see any real difference between the DOM and the tree of widgets you can build in Swing. What is it that's so brilliant about the DOM?
- sdegutis 7y agoThe DOM stitches several useful but unrelated concepts together. Besides just being a tree of composable views: * You can query elements arbitrarily deep using different patterns (depth, class names, ids, tag names, attribute presence/values). * You can attach event handlers to arbitrarily deep nodes that you just queried, not just the nodes at the level your "controller" is in charge of creating/updating like traditional frameworks. * Customizing style and behavior is entirely done via properties and composition rather than subclassing like traditional frameworks. * And more!