Replies: 1 comment
-
We don't have an official recommendation as a team, but my personal recommendation would be to not use implementation inheritance at all. It has lots of footguns that you can read up on like fragile base class, circle-ellipsis problem, yo-yo problem, etc. and it causes a sort of fundamental coupling that will make your program a pain to maintain. Luau's type system is structural, so my advice would be to rely on common interfaces for things that interact with different implementation variants, but to provide individual controlled implementations for each of those variants. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following the type annotation pattern in the docs here, what is the recommended/any way to write subtypes in strict Luau for subclasses using inheritance?
Specifically, if I have the base class
Account
then how do I write say, the type for aSpecialAccount
subclass, which may have overridden methods or a constructor with different parameters?Base class:
Beta Was this translation helpful? Give feedback.
All reactions