From: Stefan F. <ste...@we...> - 2012-07-27 13:37:45
|
Erik, thanks for your comments. See my quick replies below. Stefan On 07/27/2012 02:30 PM, Erik Vos wrote: > Stefan, > > All details aside, effectively you remove the (old-style) Portfolio holdall > objects (except for the Bank, where four of such containers are really > needed, and now are renamed to BankPortfolio). That removes a level of > indirection in many calls, so it sounds like a real improvement. All details aside, the Euro is just another European currency ;-) Jokes aside, in fact (the old-style) Portfolio survived as PortfolioModel in Rails2.0 (in rails.game.model), which is the prime example of a PortfolioHolder. So currently there is still a level of redirection involved. More precisely the Portfolio classes are specialized replacements for the general ArrayListState used before. This removes the need for a lot of manual code which was missing in ArrayListState for this special situation. > I notice that you are omitting PortfolioList. Please be aware, that in some > cases sequence matters. > For instance, IIRC, the President's certificate is occasionally retrieved > via .get(0). Of course, there are ways around that. > Only a few days ago I decided to drop PortfolioList: I already prefer to use Sets if items can only appear once inside the collection (as Java has no UniqueList included). However given the more complicated handling of undo/redo for lists, was the decisive argument here. I am aware of the casual use of the first share as the PresidentShare. I regard this as a hack, which I would like to fix in the next few days. > > I wonder why you omit d) Create two portfolios Portfolio<BaseToken> and > Portfolio<BonusToken>. > Is that because in some games BaseTokens can change into BonusTokens? > (Example: 18FL). > Good comment: I forgot to mention that I forgot to mention that I assume that the Token class extends OwnableItem<Token>. In this case it is only possible to store BaseToken and BonusToken inside Portfolio<Token> and one cannot use specialized Portfolios. So a full detailed d) would be: d) Make Token an Interface and have both BaseToken and BonusToken extend OwnableItem themselves. However then it is not possible to use Portfolio<Token> as a joint storage. |