Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Dec 2012 07:12:39 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <20fa5c05-6fcc-47ed-9e80-a44975887928@googlegroups.com> <9_6dnbVv5aTwoU3NnZ2dnUVZ8kOdnZ2d@bt.com> Subject: Re: proper use of .java files (layout) Date: Tue, 18 Dec 2012 13:09:34 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 47 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-972rmL15zEzVDdBYpaRaBYCo6KHmH/DPXA1xkvjBcli4XWPy97FaeuPCywyMZDam0vL9efV2WKNoq96!ZqA9JnH3i+9ntWp9ZOhxzlZ2iPznRb7yso4WiOGC7v8ikx7SSmvs1ENva+Lut0FX2Yjeh8fZ+iaD X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3165 Xref: csiph.com comp.lang.java.programmer:20438 lipska the kat wrote: > Notice that until now I know nothing about what game I might be > 'designing' in fact I venture to suggest that we will discover, in the > end that a Game' is nothing more than a set of rules that we can apply > to our Deck. Our Deck is made up of a number of cards from one or more > (reusable) Packs. Just want to point out that your OO "modelling" here is making quite a few asumptions about what kind of game we are going to want to play with the cards. I'm not saying that's a bad thing, but it could /get/ bad if you were doing it without being aware of it. For instance: Can cards be marked as part of the game ? (Legaloloy, I mean -- for instance "cheating" might be allowed as part of the game) If we have > 1 pack, are the two 2 of Hearts considered /identical/, or are they distinguished in some way ? (Perhaps by the colours of the backs of the cards). Can new packs be added to the game as it is played ? Can cards be destroyed (taken out of the game) as it is played ? Are there rules about who should shuffle and when ? Are there rules about who should deal and when ? Can the rules change (evolve) at "run time" ? Put it another way: you can't safely design an abstraction without knowing what the abstraction is going to be used /for/. Which is in support of Stefan's point: > I do not like the idea of designing a card game /before/ > I know exactly /which/ card game it is at all. even though I don't at all agree with his idea of starting in a procedureal mode then switching to OO later (in fact I wouldn't be /able/ to do things his way -- I find classic procedural code a lot harder to think about and/or create than the OO kind). -- chris