Say I want to implement a mathematical tool or simulator for mechanical joints.
There are different types of joints (revolute, prismatic, etc).
Which have different properties (degrees of freedom, constraints in a 2d planar system, constraints in a 3d spatial system, etc).
I can think of multiple ways to implement this. Many of them excluded for being clearly the wrong solution. But I don't have enough Python experience to know the 'best' or 'most pythonic' way to implement it.
We could have a basic class "Joint" which has
"None" for each of their properties
has get methods for the properties
A subclass for each type of joint
(wherein the properties are defined)
Or
We could have a basic class "Joint" which
takes the type of joint as an input
has a list of possible joint types
has a corresponding list for each property which defines the property value depending on joint type
has a method which finds the index for the joint type, and sets variables for each property according to the value
at that index in each of the property lists
has get methods for the properties
Or
We could have a basic class "Joint" which
takes the type of joint as an input,
has a dict defining each property depending on the joint type
has a method which defines a property variable for each dictionary
has get methods for the properties
Or, some alternate method.