With Association, Mathematica OOP can represent another style of programming. I'd like to introduce a sample of associated function selector. Let's consider next sample.
new[nam_] := Module[{},
Function[nam[x_]] ^:= <|square :> (x^2), cube :> (x^3)|>
]
Then, a construction of instance named "test" can be realized as,
new[test];
We can show the encapsulation effect of the Mathematica OOP, that is represented as variables in the CLASS are being global.
{cube = 0, test[2] = 0, test[3] = 0, square[x_] := x + 2, square[5]}
Whereas, we can get the results as,
{test[2] &[square], Function[test[2]][cube]}
and the result shows that the style of the function which can select the method with additional parameter as,
{4, 8}
where, calling the instance "test" with parameter "2" following "square" returns 4, and following "cube" returns 8.