wide-midnight-78598
11/15/2022, 1:51 PMXYZToolBase
that I see in Python and in the JVM, which adds versions, lockfiles, etc to subsystems. However, the code is copied/unique for those two classes, and the NodeJS backend will add another, and so on.
Has there been any consideration in the past about extracting some of that functionality into a set of composable interfaces, or composable functionality, for the sake of being able to quickly setup a common user-API (and then maybe changing implementation per backend, if needed)?wide-midnight-78598
11/15/2022, 1:55 PMclass AwesomeJavascriptTool(VersionMixin, Subsystem):
...
or
class AwesomeJavascriptTool(NodeToolBase): ...
class NodeToolBase(Versionable, Lockable, Subsystem): ...
While each backend has their own nuances and implementations, there are a lot of shared semantic conceptsbitter-ability-32190
11/15/2022, 2:36 PMwide-midnight-78598
11/15/2022, 2:37 PMhesitation for it in v2Hesitation for inheritance or composition?
bitter-ability-32190
11/15/2022, 2:38 PMwide-midnight-78598
11/15/2022, 2:39 PMwide-midnight-78598
11/15/2022, 2:41 PMbitter-ability-32190
11/15/2022, 2:44 PMhundreds-father-404
11/15/2022, 4:45 PMPythonToolBase
. For a long time, it was resulting in registering options that didn't make any sense for tools like setup-py
, e.g. --entry-point
. We had to redesign the base class so that users opt-in to those options, rather than being on by default
That's my main concern, when things become too implicit and you end up registering a bunch of options you didn't realize. Mixins are one way to reduce that risk, and having class properties to conditionally register options is another (but not type-safe)wide-midnight-78598
11/15/2022, 4:49 PMbitter-ability-32190
11/15/2022, 4:49 PMwide-midnight-78598
11/15/2022, 4:49 PMbitter-ability-32190
11/15/2022, 4:50 PM