4 ms·
To me this looks like exactly the sort of situation where classical OO inheritance is the right answer. All of those things are kinds of Account and should have
by captaincrowbar 11y ago
To me this looks like exactly the sort of situation where classical OO inheritance is the right answer. All of those things are kinds of Account and should have a common base class.
- Manishearth 11y agoClassical OO inheritance is the right answer in a language that supports it, though. There may be equally ergonomic ways of doing it in languages with ADTs. (Which may or may not be the case here, depending on extensibility)