Note that there are some explanatory texts on larger screens.

plurals
  1. USDavid V McKay
    primarykey
    data
    text
    plurals
    1. CORespectfully: My company maintains a massive legacy system in .Net; By MSFT's example with WinForms, the original devs used lots of inheritance to implement UI classes. We have 18 unique (though similar) combo boxes, 12 base forms, and an inheritance hierarchy up to 8 levels deep over the CLI. Our UI framework is such a maze, so inconsistent and fragile, the current dev team is terrified of the slightest change to it. But, often, all this code falls short of new needs... Composition would've meant we could pick and choose features as needed, rather than endlessly *deriving* new combinations.
      singulars
    2. COYou emphasized Widget was in an external, closed source library. If Widget.addChildWidget() took an argument of type Widget, then IMO inheritance is the only viable choice. The library has parents tracking children, but your composition example requires CustomWidgets to track their parents instead of being tracked by them. (Yuck!) If Widget.addChildWidget() took an argument of type IWidget, composition could still work, since CustomWidget could implement IWidget, while deferring some behaviours to a private Widget. btw, The real power of Interface Composition comes with IOC & DI.
      singulars
    3. COYou make some very good points. Surely your example of a replacement for '404' would be a nuissance - it takes forever to visually parse. I especially like the idea of using images or something more abstract rather than integers. I think our toolsets may allow us to annotate status codes with their meanings too, so as to solve my real beef with error codes (the need to do extra work to cross ref their meanings). What we may have here is the initial learning curve efficiency versus familiar usage efficiency problem.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload