News for hackers. Stuff that matters.
Re:UML: My Part in Its Downfall by planede on Tuesday October 04, 2022 @04:55AM (#33077930)
IMO the arrows point to the right direction, in a sense that in my mental model arrows are typically owned by the pointer, not the pointee. The pointees are typically unaware of what points to them. A base class "doesn't know" what its derived classes are. Likewise a git commit doesn't know it's descendants either.

So in my mental model a derived class actively "points to" its base class. Likewise a child commit points to its parent/parents.

Re:UML: My Part in Its Downfall by masklinn on Tuesday October 04, 2022 @05:11AM (#33078015)
> A base class "doesn't know" what its derived classes are.

There's a high variability in that, especially when metaclasses get involved and inheritance is itself a protocol (and thus can be hooked into every which way).

I do agree with the rest of your comment though, to me it also makes a lot more sense for a derived class to point to its parent than the reverse.

Re:UML: My Part in Its Downfall by arethuza on Tuesday October 04, 2022 @05:12AM (#33078024)
"derived class actively "points to" its base class"

That make sense - pretty much every language I've used that supports inheritance class definitions refer to the class (or classes) they extend rather than the other way about.

Re:UML: My Part in Its Downfall by Ensorceled on Tuesday October 04, 2022 @06:45AM (#33078586)
I like it ...

class Vehicle extendedBy Car, Truck

class Car

class Truck extendedBy Semi

class Semi

This would be almost as awesome as "comefrom"[1]

[1] https://en.wikipedia.org/wiki/COMEFROM

Re:UML: My Part in Its Downfall by fhars on Tuesday October 04, 2022 @07:10AM (#33078751)
Re:UML: My Part in Its Downfall by zozbot234 on Tuesday October 04, 2022 @07:27AM (#33078882)
You could use a generic Vehicle<T: VehicleType>, with Vehicle<Car>, Vehicle<Truck>, Vehicle<Semi> implementing specialized interfaces.