Re: Entity and Identity
Date: Thu, 23 Jul 2009 16:31:05 -0700 (PDT)
Message-ID: <f83f7fda-1d6b-43f9-9ced-2a79860afb8b_at_b14g2000yqd.googlegroups.com>
On Jul 23, 6:43 pm, Nilone <rea..._at_gmail.com> wrote:
> The problem is that "appropriate use" always requires limiting which
I'm associating OO with *any* approach (however carefully formalised)
that involves identifiable state machines that tend to be accessed
through function/procedure calls in a way that supports dynamic
polymorphism. I don't consider "OO" to be defined by the current
> features of OO you apply. Implementing interfaces are fine, but that
> should be extracted into a separate mechanism so that it can be used
> safely.
I don't understand in what way implementing and using interfaces can
be made "safe" by extracting into a "separate mechanism" that
presumably is no longer OO. If that's what you mean you're going to
need to justify such a bold statement!
> There are other appropriate uses that could, and should, be
Can you give an example? I don't mean an example of a poor
application of OO (they're everywhere), but rather an example of two
> formalised. Each aspect of OO was meant with good intentions, and
> works individually, but not together.
> It is easy to contrive an interface to a flushable output stream by
> passing around pointers to shared memory containing executable code
> and space for buffers and whatever else you want to do. It would be
> safe when used appropriately. BTW, GOTO is useful too, when used
> appropriately.
I fail to see the point you're making here. My point was that OO was a natural fit for the concept of a state machine representing an output stream, and FP, LP, RM+RA are not. The implication is that OO is sometimes useful. You appear to be arguing that OO is never useful. Is that right?
An OO style language makes it relatively easy to directly express the
concepts of 1) defining the state machine interface, 2) implementing
the interface and 3) using the interface.
The following might be a better example:
struct Task
struct ThreadPool
ThreadPool* CreateThreadPool();
Note that the execute and abort methods on an abstract task have no
"data exchange" whatsoever (they takes no arguments and have no return
value). For that reason an abstract task is hardly going to map into
a "data centric" language (such as a pure FP language).
I think thread pools are a useful concept and OO is a very good fit.
> The point is, if we're going to have abstraction mechanisms, it needs
If you're saying that the RM is a well defined mathematical formalism
whereas OO is not then I completely agree.
{
virtual void Execute() = 0;
virtual void Abort() = 0;
};
{
virtual void Close() = 0;
virtual void PostTask(Task*) = 0;
};
> to be the right mechanism. The relational model is an example of
> such. It works for any composition of its features. The user may not
> understand the model, and thus the consequences of how they use it,
> but that is not the fault of the model. The information is available,
> and the consequences of applying the model is clearly defined.
It's not clear what you mean when you imply that the consequences of using OO aren't clearly defined. For example, with effort one can write OO programs in a particular language and construct proofs of correctness against requirements. Nondeterminism isn't the problem! Difficulty of writing correct programs is the killer.
> With OO, only a very specific subset of the possible compositions of
> its features are valid and useful. Using some features together
> breaks the promises made by the abstraction mechanism, i.e. it
> violates its own reason for existence when used incorrectly. And
> doing is so is very, very easy.
>
> I believe programmers will be best served by completely discarding OO
> as currently understood.
I don't find your argument persuasive. I would simply say that OO is (only) well suited to a narrow problem domain. Since programming general purpose state machines is very difficult it stands to reason that OO should only be used by competent programmers in those instances where it is appropriate. Received on Fri Jul 24 2009 - 01:31:05 CEST