<thomas.mertes@[EMAIL PROTECTED]
> wrote in message n
> Hello,
> I am writing a chapter about object orientation.
> It would be nice to get some feedback about it
> before the final release. Here is it:
>
> 7. OBJECT ORIENTATION
> =====================
>
> The object orientation of Seed7 is based on terms like
> interface and implementation. An interface defines which
> methods are supported while the implementation describes
> how this is done. Several classes with different method
> implementations share the same interface. This view is not
> something new. When you write to a file (in C under UNIX)
> you use the same interface (higher level printf or lower
> level write) for harddisk files, console output and printer
> output. The implementation does totally different things
> for this files. UNIX uses the "everything is a file"
> philosopy for ages (even network communication uses the
> file interface (see sockets)).
>
Liven this up. The first paragraph, in particular, should be mainly human
interest.
I'd guess that most of your readers know perfectly well what
object-orientation is all about, but you have to cater for the person who
doesn't. So it is quite tricky to explain to the last group without boring
or patronising the majority.
I'd take this by the horns.
Many people will be familiar with object-orientation from languages like
C++, Smalltalk, and Java. Seed7 follows the route of declaring
"interfaces".
An interface is a common set of operations supported by an object. For
instance cars, motorcycles, lorries and vans can all accerate or brake, if
they are legal to drive on the road they can all indicate right and left.
This view isn't new. C provides a primitive form of interfacing. When you
write to a file in C you use the same interface (fprintf) for for harddisk
files, console output and printer output. The implementation does totally
different things
for this files. UNIX has used the "everything is a file" philosopy for
ages
(even network communication uses the file interface (see sockets)).
For those who are familiar with the idea, I will now provide a very quick
example of how to define and use a "shape" interface with Seed7.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


|