Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Languages Misc > Re: Preview cha...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1106 of 1154
Post > Topic >>

Re: Preview chapter about object orientation

by "Malcolm McLean" <regniztar@[EMAIL PROTECTED] > Feb 10, 2008 at 05:56 PM

<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




 2 Posts in Topic:
Re: Preview chapter about object orientation
"Malcolm McLean"  2008-02-10 17:56:50 
Re: Preview chapter about object orientation
"Malcolm McLean"  2008-02-11 14:05:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:07:19 CDT 2008.