Objects With No Behavior
Posted
by
Patrick Donovan
on Stack Overflow
See other posts from Stack Overflow
or by Patrick Donovan
Published on 2012-06-23T14:07:59Z
Indexed on
2012/06/23
15:16 UTC
Read the original article
Hit count: 265
python
|object-oriented-analysis
I've been teaching myself object oriented programming and I'm thinking about a situation where I have an object "Transaction", that has quite a few properties to it like account, amount, date, currency, type, etc.
I never plan to mutate these data points, and calculation logic will live in other classes. My question is, is it poor Python design to instantiate thousands of objects just to hold data? I find the data far easier to work with embedded in a class rather than trying to cram it into some combination of data structures.
© Stack Overflow or respective owner