Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.acsu.buffalo.edu!news.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.sgi.com!rutgers!utcsri!info.ecf!doylep
From: doylep@ecf.toronto.edu (Patrick Doyle)
Subject: Re: What is wrong with OO ?
Sender: news@ecf.toronto.edu (News Administrator)
Message-ID: <E440xD.Lu0@ecf.toronto.edu>
Date: Thu, 16 Jan 1997 16:39:12 GMT
X-Nntp-Posting-Host: spark15.ecf
References: <JSA.97Jan1181506@alexandria> <32D11FD3.41C6@wi.leidenuniv.nl> <E3pzy4.DHE@research.att.com> <01bbd23a$5b667cc0$LocalHost@christophe-leph>
Organization: University of Toronto, Engineering Computing Facility
Lines: 18
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:240831 comp.lang.smalltalk:49235 comp.lang.eiffel:17390 comp.lang.ada:56055 comp.object:59897 comp.software-eng:52598

In article <01bbd23a$5b667cc0$LocalHost@christophe-leph>,
Vos nom et prnom <gaijin@infonie.fr> wrote:
>Just a question about it (I just posted a new thread about this) : when a
>member function is better as non virtual ?

  Suppose a function does some important manipulation of private data
members.  If it were virtual, then an heir class could override this
function without ever calling it, and the data manipulation would never
happen.  This could leave the object in an invalid state.  In C++, the
only way to prevent this is by NOT declaring the function virtual.

  In Eiffel, I presume, this could be prevented using postconditions?


-- 
--
Patrick Doyle
doylep@ecf.utoronto.ca
