From: Erik V. <eri...@hc...> - 2005-04-02 15:33:12
|
The brilliant weather here in the Netherlands prevents me from doing any coding this weekend (that would be a waste). But I do want to take time to explain my ideas of how to deal with shares, ownership etc. 1. The basic unit of property would be Certificate (rather than Share). Attributes would include Owner (see below), share (percentage), certificateCount (against the limit - can be 0, 0.5 or 1). 2. Each tradeable object would implement an interface Tradeable. This would apply to Certificates and PrivateCompanies. PublicCompanies are not themselves Tradeable, but hold an array of Tradeable Certificates. Minor companies like those in 1835 will have one 100% Certificate (to avoid the need for a subclass MinorCompany extends PublicCompany implements Tradeable). 3. Each entity that can hold Tradeables (certificates and private companies) has a Portfolio containing some collection of Tradeables. This applies to Player, PublicCompany and the Bank (the Bank would have two Portfolios: IPO and Pool). Portfolio could be a separate class, perhaps a subclass of some Collection type (ArrayList or HashMap). Or it would contain such a Collection type. Not sure what's better. 4. Each entity that has a Portfolio implements an interface Owner, so that each Tradeable can have an attribute defining its Owner. 5. Maybe we will also need a separate interface Trader, to define methods that an actively trading Owner must have (sell, buy). This assumes that the Bank does not need such methods (it does not initiate sell/buy actions). If it does, Owner and Trader will converge into one interface. Erik. |