From: Brett <wak...@ea...> - 2005-04-05 19:49:58
|
On Tue, 2005-04-05 at 21:38 +0200, Erik Vos wrote: > > > > for each company, for each share, get player name, allocate a share of > > the dividend. > > Er... how does "get player name" work, if a share does not know its owner? > I think you are proving my point here. > I probably am. > Please also note, that Stewart assumed a path (relationship) from Stock to > Entity - > in my case that would be from Certificate to Portfolio (rather than Owner, > because in paying out we must be able to distinguish IPO and Bank Pool). > > The Portfolio would know to which (type of) Treasury to add dividends. > To me this looks like another good reason to have this Portfolio class. > > Here is my revised proposal: > > 1. We have a Portfolio class, which has the following: > - a collection of PrivateCompanies, > - a collection of PublicCompany Certificates, > - the knowledge to which type of treasury dividends must be > paid out for shares in this Portfolio and ways to find it > (this treasury varies per game for the BankPool and IPO portfolios). > - maybe a reference to an Owner (or Shareholder: Bank, Player, > PublicCompany), > which is the entity that owns the money involved in buying and selling the > above, > (but possibly we don't really need it. If we do, we also need an Owner > interface). > - perhaps other common info or methods. > This looks good. I've already defined Player and Bank class stubs. We can probably get away with just using overloaded methods to obtain the owner of the stocks, one that returns a Player object and one that returns a Bank object. > 2. Each PrivateCompany and Certificate has a portfolio attribute, > to know where to look for info on where to drop cash. > > 3. Payout is simply a loop per company over its certificates, > backtracking references as stated above to find each one's payout treasury. > > This way we don't need Tradeable. Not sure yet about Trader. > > I think it is time to start writing some code to see what works and what > not. > Perhaps next weekend, if the weather is bad enough.... > Sounds good to me. ---Brett. temporary routing anomoly |