From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: doylep@ecf.toronto.edu (Patrick Doyle) Subject: Re: What is wrong with OO ? Date: 1997/01/16 Message-ID: #1/1 X-Deja-AN: 210214479 x-nntp-posting-host: spark15.ecf sender: news@ecf.toronto.edu (News Administrator) references: <32D11FD3.41C6@wi.leidenuniv.nl> <01bbd23a$5b667cc0$LocalHost@christophe-leph> organization: University of Toronto, Engineering Computing Facility newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-16T00:00:00+00:00 List-Id: In article <01bbd23a$5b667cc0$LocalHost@christophe-leph>, Vos nom et pr�nom 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