From: John D. G. <jd...@di...> - 2014-04-26 14:32:46
|
On 2014-04-26 06:56, Stefan Frey wrote: > John: > I agree with the content of your proposal. > > We differ in the fact that I prefer composition over inheritance for > companies in Rails. I am an old C++ programmer and think that way, but I'm willing to use interfaces rather than inheritance if it makes things easier for you. I haven't yet read the page you cited, but I will. > My favorite structure would be do define the following interfaces (or > before Java 8 abstract classes): > > CompanyOwnership > CompanyOperation > CompanyCreation > > Concrete implementations would be e.g. PrivateOwnership and > PublicOwnership, TrainRunning and FixedDividend and > CreationByNationalization, CreationByMerger and CreationByIPO. > > which when allow to define only one company class and then set the > ownership, operation and creation behavior accordingly. I like that idea too. > One detailed comment: > My proposals were for XML templates, it did not imply creating new Java > classes. XML company templates are much more lightweight than new classes. I have noticed both techniques in the code, but am still figuring out how they interact. > Except from that I fully agree with your proposal, however it would be > great if you were able to include 1856 (and current prototypes 1826, > 18Scan?) into your analysis of nationalization? Those games' mergers are very similar to each other, but not to 1835/37 (not only no reserved shares, but no predetermination of what companies will merge). So I think they should have their own class rather than be included in the one I've called NationalCompany -- but maybe I should use some other name, since CGR and Etat/SNCF are national companies too. |