Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!uh2 From: UH2@psuvm.psu.edu (Lee Sailer) Newsgroups: comp.object Subject: Re: Views in OO languages Message-ID: <90039.113649UH2@PSUVM.BITNET> Date: 8 Feb 90 16:36:49 GMT References: <1385@tnoibbc.UUCP> Organization: Penn State University Lines: 20 In article <1385@tnoibbc.UUCP>, werner@tnoibbc.UUCP (Werner de Bruijn) says: > >Does anyone know how a view on a class can be implemented? The idea comes >from database environments where instances of a class can be derived from >instances of other classes. Right off, I can think of two ways, assuming that I understand what you mean by "views." The simple case is where there is an object, say anEmployee, and you want some users to only have access to certain of anEmployees attributes and methods. Just create a subclass of anEmployee, say aRestrictedEmployee. Use stubs to hide those methods that need to be hidden, recode those methods that need more or less security, create new PrintAs or DisplayAs methods, and so on. In the database world, views are often complicated joins of many types of thing. In this case, systems with multiple inheritance would work better than those with single. Of course, the usual tricks for simulating multiple inheritance like behavio should still work. lee