Re: Whose Fish - OO solution
- From: topmind <topmind@xxxxxxxxxxxxxxxx>
- Date: Tue, 12 Jun 2007 08:39:55 -0700
Kreeg wrote:
topmind wrote:
Jordan Marr wrote:** SNIP Jordan's original post **
I never posted my solution to Whose Fish, and since my old thread
probably has a stigma attached to it, I'll post it here.
I was thinking of a way to make this problem more real-world instead
of textbook-puzzle-ish. One possible application would be crime
solving, or perhaps terrorist tracking. Data about people, places,
things, and relationships would all be in a data wearhouse and an
inference engine of some type could chew on it to find potential
trouble spots or leads. (Instead of "who has the fish", the
questions may resemble, "who may have a bomb".)
So, changing the nouns makes the problem more 'real world'? I don't buy
that. The problem was fine as it was IMO, and changing the nouns
around wouldn't really add anything.
You got me thinking. If you are doing a one-time or very specific
simulation, then perhaps you are right. That is pretty much what
Simula-67 was for, where OO was formally invented. They had tugboats,
freighters, and loading docks and wanted to test the productivity of
various scenarios. Simulations are certainly needed, otherwise
Simula-67 wouldn't have been made. Perhaps the type of problems Simula
was used for would be a better representation of a "real-world"
version of this kind of puzzle than my crime/terrorist finder
scenario. Being that I don't work on those kind of problems, I didn't
really think about Simula-bound-stuff until now.
However, my understanding is that simulation tools are becoming
graphical in nature such that one drag and drops widgets and puts
verious constraints on the visual "objects". There is coding, but it
is mostly for event-handlers (if-bumped, if-moved, if-within-X-units-
of-thing, etc.), not the framework itself. But I'll let a simulation
expert make an informed comment on that.
However, an inference engine would certainly be an interesting way of
solving the problem, I think.
Perhaps that would just be reinventing Prolog :-)
One change from your kind of solution is that specific instances would
not be hard-wired into the app code. Classification systems would also
not be hard-wired if we really don't want to make programmers
glorified data entry clerks. People, places, things, and categories
will be entered by domain experts, not programmers for the most part.
IMO, moving the noun definition outside of the hard-coded approach in
the example neither adds nor takes away from the solution itself. The
Sql approach that someone posted in the previous thread [1] was similar
to Jordan's approach in this way, in that both of them were 'hard-wired'
into the solution, as you say.
The most interesting piece of this problem IMO is not how the houses,
people, and streets get entered, but how the program goes about finding
the correct answer given sets of these things and a set of rules.
Again, It would be interesting to see a Prolog solution in the sense
you tell it the logic rules and then ask questions over those rules.
It always seemed to me that if you remove domain classification from
app code, the result will not be very OOP. There would be little or no
need for inheritence or polymorphism. If you disagree, I would like to
understand why, with perhaps some examples.
Heck, Jordan's solution has very little inheritance or polymorphism.
That doesn't mean I don't think it's a perfectly valid approach.
My comment was about the matter of being OO versus not being OO, not
necessarily "valid" or not. Jordan's solution is not that OO. It
mostly only uses encapsulation, not the other two. That is, the
operations and data structures are bound together in the OO "self-
handling-noun" way. Thus, on a continious scale, it has a fairly low
amount of "OO-ness" if you will. A "direct" procedural solution would
not be much different except that the data structures would be
"naked". (Whether this is good or not will take us back to the ol'
database versus app-RAM fights.)
[1] http://groups.google.com/group/comp.object/msg/cec9e241f760a89a
-T-
.
- Follow-Ups:
- Re: Whose Fish - OO solution
- From: Jordan Marr
- Re: Whose Fish - OO solution
- From: Kreeg
- Re: Whose Fish - OO solution
- References:
- Whose Fish - OO solution
- From: Jordan Marr
- Re: Whose Fish - OO solution
- From: topmind
- Re: Whose Fish - OO solution
- From: Kreeg
- Whose Fish - OO solution
- Prev by Date: Re: Law of Demeter can be supported without eliminating object coupling
- Next by Date: Re: Whose Fish - OO solution
- Previous by thread: Re: Whose Fish - OO solution
- Next by thread: Re: Whose Fish - OO solution
- Index(es):
Relevant Pages
|