From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.9 required=5.0 tests=BAYES_50,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: Loryn Jenkins Subject: Re: Which wastes more time? (Was Re: Software landmines (loops)) Date: 1998/09/07 Message-ID: <35F30B44.EDF1F9F2@s054.aone.net.au>#1/1 X-Deja-AN: 388510473 Content-Transfer-Encoding: 7bit References: <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <6sebjr$b69$1@nnrp1.dejanews.com> <6sff74$q0s@gurney.reilly.home> <6sh2j5$jnl$1@nnrp1.dejanews.com> <35EC2E5A.16DB6CB1@bigfoot-.com> <6sjc0a$1lk$3@news.indigo.ie> <35EFB09E.15412933@s054.aone.net.au> <35f2bd98.40599408@news.erols.com> <35F06A58.F968BDE1@s054.aone.net.au> <35f48276.90997557@news.erols.com> <35F0C3C9.D1E56FF3@s054.aone.net.au> <6srh67$sj5$1@hirame.wwa.com> <35F1C0B9.8A50CEB0@s054.aone.net.au> <6ssmjd$h0l$1@hirame.wwa.com> <35F20C37.89A79442@s054.aone.net.au> <6su5ir$co8$1@hirame.wwa.com> X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii X-Trace: news.mel.aone.net.au 905120622 12631 203.12.186.53 (6 Sep 1998 22:23:42 GMT) Organization: TekRite Pty Ltd Mime-Version: 1.0 Reply-To: loryn@acm.org NNTP-Posting-Date: 6 Sep 1998 22:23:42 GMT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-06T22:23:42+00:00 List-Id: > >By the way, can you conceive of a situation in which it would be > >incorrect to model a role of some class using the Role Pattern? (Just > >wondering, because whenever I come across a situation like this, I > >reflexively reach for this 'tool'.) > > Have you ever seen the game program "Sim Tower"? This is one of those > interesting simulation programs. You are the manager and architect of a > skyscraper. You must put rooms, lobbies, elevators, restaraunts, condos, > etc, etc, into the building. Simulated people are attracted to the building > by your amenities and they either buy condos or rent hotel rooms. You > slowly grow the skyscraper, floor after floor, adding more and more > amenities while more and more people use your services. The process of > growth is delicate. If you over invest, or if you do not provide the right > ratio of amenities, or if you under spend on maintenance, people start to > move out, your income base crumbles, and you face a downward spiral. > > Now, the simulated people come in many forms. Lets consider two, the > breadwinners and the homemakers. In the morning the breadwinners take the > elevators to the garage where they drive to work, whereas the homemakers use > the amenities of the skyscraper to buy groceries, etc. etc. > > These are certainly two different roles. However, in the context of the > simulation, the objects are born and die in that role. Therefore it would > not be incorrect to model this with a PERSON base class and with BREADWINNER > and HOMEMAKER deriving from PERSON. Indeed, since we have to deal with > thousands of these little objects, we will be strongly motivated to > eliminate the pointers and delegations that a ROLE relationship implies. Ah! Games from Maxis. I've never seen Sim Tower, but I have seen Sim City, Sim City 2000 and Sim Earth. I enjoy these games, together with Myst and Riven, more than any other type of game. Now. I don't think these are examples of PERSONs. Take a look at the "coherent sets of behaviour" exhibited by these entities: the Role is co-extensive with the entity itself; I certainly would not reach for my "Role tool" here. Instead, BREADWINNER and HOMEMAKER fit the three tests I apply for sub-typing: (1) Is a { BREADWINNER | HOMEMAKER } a SIMULTON for its entire existence? (A1) Yes. (2) Can a SIMULTON be a { BREADWINNER | HOMEMAKER } for its entire existence? (A2) Yes. (3) Are BREADWINNERs disjoint from HOMEMAKERs? (A3) Yes. This is a different world, a different reality. You have chosen something that superficially resembles "our world" of people who act in certain roles; but they aren't. Can you think of any other example that more closely fits my question? Loryn Jenkins