Re: Real world musings
From: Cristiano Sadun (TAKEcristianoTHISsadunOUT_at_hotmail.com)
Date: 12/16/03
- Next message: Paul Sinnett: "Re: Test Driven Development Sample"
- Previous message: Paul Sinnett: "Re: Test Driven Development Sample"
- In reply to: Richard MacDonald: "Real world musings"
- Next in thread: Paul Campbell: "Re: Real world musings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 16 Dec 2003 14:07:02 +0000 (UTC)
Richard MacDonald <macdonaldrj@worldnet.att.net> wrote in
news:Xns945167F94DCF0macdonaldrjworldneta@204.127.36.1:
> But I still believe that the best OO model is one that closely models
> the "real world".
Well, there are aspects for which this is definitely true. Names are my
favouite here, as I think of them as extremely important. Calling a class
"Dog" makes clear what's supposed to model - calling it "D" less. That's
why I quite dislike interface or class names starting with "I" and "C".
There are some dangers - if u do expose some service in "Dog" which hasn't
anything to do with dogs, it'll make things even more confusing for the guy
reading your design. On the other side, knowing that helps a lot to keep
classes focused and simple.
Also, the relationships. "business" objects (by which I mean: any type -
properly named - which model a concept that would be recognizable to
someone knowing the problem domain) in my designs, tend to have
relationships miming the "real" counterparts; at least as a starting point.
After all, you have to start somewhere.
What I call "system" objects (stuff like lists, stacks, queues, actions,
alghoritms, factories, etc) are there only because we're attempting to
solve a problem with a computer and with a certain paradigm. An equivalent
solution thought by, say, Babbage, would have "wheel" and "carriage"
instead. They have little to do with the "real world" - unless the real
world in question is the computing world itself (or every domain where a
"list" is a business object :).
Apart from that, a set of passive objects hosted in a address space has
little to do with "real" objects, I think. A printer object is not a
printer even when it's living in core, and a wall object is not a wall. You
have to *ask* it whether you've bumped into it or not.. a real wall,
usually, isn't that polite. :)
-- You dont know what to do when you dont know what you're doing. http://space.tin.it/computer/csadun
- Next message: Paul Sinnett: "Re: Test Driven Development Sample"
- Previous message: Paul Sinnett: "Re: Test Driven Development Sample"
- In reply to: Richard MacDonald: "Real world musings"
- Next in thread: Paul Campbell: "Re: Real world musings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|