As for the methods: each Foo.method (Bar1 b1, Bar2, b2) method, by definition, can always have alternative equivalent constructions:
Bar.altmethod (Foo f, Bar b2)
and
static staticmethod (Foo f, Bar b1, Bar b2)
And you could also wrap this last method as an intsance method in a service class, which itself is a singleton (so the static nature of the method is a little bit hidden by the class in which it is located).
The only convincing reason why your method is an instance method of a class of one of the method arguments (static version) is when you expect subclasses for this class to be available and that it can be useful for these subclasses to have a specialized method implementation.
Imagine
class GeographicalFigure {Object quadrature () {...}}
Perhaps it would be useful to leave the possibility of a later addition
the Circle class extends the geographic reference {Object quadrature () {throw new ThisIsNoGoodException (); }}
In addition, all of your options are essentially equivalent.
Erwin smout
source share