From: Erik V. <eri...@hc...> - 2005-03-01 23:18:21
|
The practical side of it is what kind of code we want to write: endless checks of booleans or lists being empty or not (all through getters), or endless "instanceof" checks. Not sure what I prefer..... Erik. > -----Original Message----- > From: rai...@li...=20 > [mailto:rai...@li...] On Behalf Of=20 > Brett Lentz > Sent: 01 March 2005 23:34 > To: rai...@li... > Subject: RE: [Rails-devel] Re: Suggested object model for=20 > core generic framework >=20 > I'm thinking this is probably a good case for creating an=20 > abstract base-class that we can use to derive each of the=20 > special cases from while still inheriting all of the more=20 > "standard" abilities.=20 >=20 > All we need to do is separate out what items are common to=20 > all companies, and which are special cases. >=20 > I think that some things, like whether a company can own=20 > shares of stock (e.g. 1870), and whether it can't (e.g.=20 > 1830), can be covered by a simple boolean because we'll=20 > already be writing the code to manipulate the stocks=20 > elsewhere, so the only thing the company will need is a=20 > conditional check of the boolean before initializing an=20 > ArrayList to hold the company's stocks. >=20 > The really deviant stuff, like minor company's ability to=20 > become major companies, or the folding in the shares of=20 > several companies into a single company (e.g. 1856's creation=20 > of the Canadian National Railway) probably need specific=20 > definitions unto themselves. These are the sorts of things=20 > that, IMO, have no business being in the more generic=20 > "default" classes. >=20 >=20 > ---Brett. >=20 >=20 > *********** REPLY SEPARATOR *********** >=20 > On 3/1/2005 at 8:23 PM Erik Vos using eri...@hc... declared: >=20 > >But what is then the distinguishing feature of a Minor company? > >Minors come with 1 (1835/37, 18EU), 2 (1854) and 5 (1826,=20 > 1841) shares. > >Some can convert to major companies (1826), others can merge into > >new major companies (1835/37, 18EU, 1841) or new minor companies > >(1854: "local" (1-share) to "major local railway" (2-share)).=20 > > > >IMHO, the only fundamental division is between companies=20 > that can be traded > >(i.e. shares can be sold: most if not all of the >1-share companies) > >and those that can't (most if not all of the 1-share companies). > >Perhaps that distinction warrants subclassing, but I'm not sure. > > >=20 > ********** REPLY SEPARATOR END ********** > This message sent with 100% recycled electrons. >=20 >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from=20 > real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dick > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel >=20 >=20 |