I would say that all values are objects anyway. Say that instead of an instance of a transaction class, you will have the dictionary {'transaction name': [123, 'GBP', '12 / 12/12 ', 1234,' in ']}. Now this dictionary is again an object, and the difference is that it was not your own class. Anyway, an object. The fact that something is an object does not automatically make it bulky, large, slow, or any other. You probably still need to account for these transactions, how many of these objects do you want to keep in memory at a given time?
In my opinion, this is a matter of clear code design. Suppose you now have a cool book that has an action method that accepts transaction objects as an attribute. When this action method uses the properties of an object, it will be much clearer than if it referred to the nth elements of the list, for example.
The fact that this is a class also leaves you with the ability to change or add functionality in the future. For example, you can add the registration of the entire transaction or remove the method at some point.
Damian
source share