Which would be the best way to implement a swap method in OOP? Basically the method just swaps (some) values of the same object type
a.) objectB = objectA.Swap(ob jectB) [returns new B and modifies A]
-or-
b.) objectHelper.Sw ap(objectA, objectB) [passing each object by ref]
-or-
c.) ????
Don't worry about what's actually getting swapped, I'm really interested in the best OOP method (low coupling, etc).
a.) objectB = objectA.Swap(ob jectB) [returns new B and modifies A]
-or-
b.) objectHelper.Sw ap(objectA, objectB) [passing each object by ref]
-or-
c.) ????
Don't worry about what's actually getting swapped, I'm really interested in the best OOP method (low coupling, etc).
Comment