Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!news.sprintlink.net!tank.news.pipex.net!pipex!news.mathworks.com!fu-berlin.de!news.belwue.de!News.Uni-Marburg.DE!news.th-darmstadt.de!isa.informatik.th-darmstadt.de!kuehne From: kuehne@sun46.isa.informatik.th-darmstadt.de (Thomas Kuehne) Newsgroups: comp.lang.beta Subject: Re: unusual inner Date: 27 Jul 1995 11:28:55 GMT Organization: TU Darmstadt, Praktische Informatik Lines: 68 Distribution: world Message-ID: <3v7t9n$147f@rs18.hrz.th-darmstadt.de> References: <3ulin4$h07@rs18.hrz.th-darmstadt.de> <3uvr75$5e3@belfort.daimi.aau.dk> <3v5451$12j2@rs18.hrz.th-darmstadt.de> Reply-To: kuehne@isa.informatik.th-darmstadt.de NNTP-Posting-Host: sun46.isa.informatik.th-darmstadt.de In article , wpp@marie.physik.tu-berlin.de (Kai Petzke) writes: > With most languages, you can emulate one construct from the one > language with a few constructs from the other language. Super calls aren't that easy to emulate in BETA, are they? With 'Super calls' I mean the possibiltiy to override a method and freely use the code of the old method in the new method. One way to achieve it in BETA might be to use component patterns, that implement the code. Thus the new method could use the same code components, that the overidden method does. However, this looks awful to me. > If I understand you right, one point of your complaint was, that > BETA lacks virtual methods, which can be completely redefined in > a subclass, while C++ has them. Yes and no. That you can not overide is one problem. The other problem is that you can not freely use the old code in the new method. > You need to define just one pattern > to modell that behaviour in BETA as well: > > [ ... example deleted ...] I feel very uneasy to simulate overriding with the help of a variable. Is this recommended BETA style? Worst of all, you still have to know in advance, that your method is going to be overridden. > I do not understand that problem, especially, when compared to C++. > A pattern with a do-part but no INNER is like a method in C++. None > of them can be further extended. Yes, but C++ does the same "fault". In Eiffel *any* method can be overridden by default, since - in C++ speak - every method is virtual by default. Therefore you only have to think about future uses, if you are sure that noboday shall override your method (then you declare it as 'frozen'). Declaring every method 'virtual' by default in C++ seems more reasonable than applying the 'overideable' scheme to a method by default. > If you foresee, that you need more than one inner, ... Clairvoyance is really a problem in software engineering (or in prototyping, if you want to restrict it to that). +---------------------------------------------------------------------------+ | Thomas Kuehne | | Institut fuer Systemarchitektur | | Fachgebiet praktische Informatik Tel.: 06151/165420 | | Technische Universitaet Darmstadt Fax.: 06151/165472 | | Magdalenenstr. 11c kuehne@isa.informatik.th-darmstadt.de | | D-64289 Darmstadt http://www.isa.informatik.th-darmstadt.de/~kuehne | | | +---------------------------------------------------------------------------+