Obviously, I've been away from class designing for a while ;)
Trying to shake the rust off by designing a little system to hold my financial info. I intend to do this the right way (with UML), but I can't resist peeking ahead a little bit. And of course if I get hung up while peeking ahead, I have to have it resolved ;(
I'm a little hung up here:
At some point ACCOUNT (holding maybe owner name(s), account number, & open() close() methods etc... should be a abstract base class. This seems obvious, but is it just as obvious to say that, well, all accounts have the possibility of TRANSACTIONS. (which could including a bare minimum of date, description & amount).
As I'm thinking that INVESTMENT_ACCOUNT can derive from ACCOUNT, but how to work in the idea that the transactions for INVESTMENT_ACCOUNT will need to also have info like: "shares transacted" or "share price".
Now I don't like the idea of force fitting it and saying that even TRANSACTION should contain "share price", just have it be $1.00.
Possibly use this in Account:
list<TRANSACTION*> m_activity;
And the CTOR of INVESTMENT_ACCOUNT can populate the list with allocated INVESTMENT_TRANSACTIONs which would derive from TRANSACTION and add on share_price & nbr_of_shares_transacted?.