Added upstream from http://ftp.icm.edu.pl/pub/loglan/
[loglan.git] / HTML / MicroMan / Protecti.htm
1 <!doctype html public "-//IETF//DTD HTML//EN">\r
2 <HTML>\r
3 \r
4 <HEAD>\r
5 \r
6 <TITLE>Protection techniques</TITLE>\r
7 \r
8 <META NAME="GENERATOR" CONTENT="Internet Assistant for Word 1.0Z">\r
9 <META NAME="AUTHOR" CONTENT="NOM">\r
10 </HEAD>\r
11 \r
12 <BODY>\r
13 \r
14 <H4><U><I>Loglan 82, A micro-manual of the programming language\r
15 - Basic constructs and facilities</I></U></H4>\r
16 \r
17 <H1><IMG ALIGN=MIDDLE SRC="gifs/logo2.gif"> 10) Protection techniques\r
18 </H1>\r
19 <HR>\r
20 \r
21 <P>\r
22 Protection techniques ease secure programming. If a program is\r
23 large, uses some system classes, is designed by a team etc., this\r
24 is important (and non-trivial) to impose some restrictions on\r
25 access to non-local attributes.\r
26 <P>\r
27 Let us consider a data structure declared as a class. Some of\r
28 its attributes should be accessible for the class users, the others\r
29 should not. For instance, in class Bst (p.7) the attributes member\r
30 and insert are to be accessible. On the other hand the attributes\r
31 root, node and help should not be accessible, even for a meddlesome\r
32 user. An improper use of them may jeopardize the data structure\r
33 invariants.\r
34 <P>\r
35 To forbid the access to some class attributes the three following\r
36 protection mechanisms are provided: <B>close</B>, <B>hidden</B>\r
37 and <B>taken</B>.\r
38 <P>\r
39 The protection close defined in a class forbids remote access\r
40 to the specified attributes. For example, consider the class declaration:\r
41 <P>\r
42 <IMG SRC="gifs/pt01.gif"> \r
43 <P>\r
44 Remote access to the attributes x,y,z from outside of A is forbidden.\r
45 <P>\r
46 The protection hidden (with akin syntax) does not allow to use\r
47 the specified attributes form outside of A neither by the remote\r
48 access nor in the units prefixed by A. The only way to use a hidden\r
49 attribute is to use it within the body of class A.\r
50 <P>\r
51 Protection taken defines these attributes derived from prefix,\r
52 which the user wishes to use in the prefixed unit. Consider a\r
53 unit B prefixed by a class A. In unit B one may specify the attributes\r
54 of A which are used in B. This protects the user against an unconscious\r
55 use of an attribute of class A in unit B (because of identifier\r
56 conflict). When taken list does not occur, then by default, all\r
57 non-hidden attributes of class A are accessible in unit B. <HR>\r
58 \r
59 <P><hr>\r
60 <A HREF="FormalTy.htm"><IMG SRC="gifs/PrevPage.gif"></A> \r
61 <A HREF="HomePage.htm"><IMG SRC="gifs/HomePage.gif"></A> \r
62 <A HREF="Programm.htm"><IMG SRC="gifs/NextPage.gif"></A> <HR>\r
63 \r
64 <ADDRESS>\r
65 Last update 02/07/95 \r
66 </ADDRESS>\r
67 \r
68 <ADDRESS>\r
69 Comments, suggestions and critiques are welcome to : <A HREF="mailto:linfo062@crisv2.univ-pau.fr">linfo062@crisv2.univ-pau.fr</A>\r
70 \r
71 </ADDRESS>\r
72 \r
73 </BODY>\r
74 \r
75 </HTML>\r