     24 

      -  

    24.1.  

          ,    
   - .   , 
  ,       
  ,    -  . 
,         
-,       (., , 
[24.2]).       :	. 
         . 
       . 
       . 
        . 
       . 
     ,  -    
     . 
    	"" (..     ). 
    	  . 
    	",   " (..    ). 
    	 . 
              
       
- . 

    24.2.         

           OPAL , ,  
       ( 
  SQL),  -     
    .    , 
    ,     ,   
    .      
  ,      ,  
-     (   
      ). 

    634	 VI. -  

     , ,    [24.2], 
     .  
   [22,12]     : 
    "        
-       , 
         ". 
      -      
    ,   
   ,     SQL, 
     . ,  
          
  .    , 
  ,      ,   
      (  
 - ),     
    .  
    -  
    ,     
,  IMS  IDMS. 
         ,    
  -   
, ..      ( 3GL  third 
generation language).       
     .  , 
       ,  
,     ,    
    (   
  ).  ,     
    ,   - " " 
(,   - ),   - 
    "  "   
OPAL,  C++,  -  - ,  
      . 
      , ,     
- ,        
  OPAL ( -    Smalltalk)  
C++. ,  C++ [24.6, 24.10]     
      (     
 " -").      
     C++. 

    .        
  ,     . 
,      22,    
       .   
    -   
    . (   
    SQL    Object SQL  OSQL, 
     ,       
  SQL.)        , 
  -      : 
   ,     . 

            . 

     24.   - 	635 


     

       ,     
,   ,    
.. [24.4, 24.8, 24.9],      
  .   -  
     .    
    . 
               
            
 ,      (,   
)      . 
               
             
 (        ). 
        ( )  . 
              . 
     , ,    . 24.1,    
     ( V.2     
     V.3a  V.3b,     
  V.4). 

    . 24.1.      

         ,  
    .    
    .    
    . 
               
(,  ""   ""). 
                
(..    ""     ""). 
             
,        (  
    )         
   . 

      

     -      
,      ,  
  13  14,   .     ,  
(  )      
   ,      
.      : 

    636   VI. -  

    1.   ( )       
    ,     
  . 
    2.          
  (    ). 
      1       
,    2       
   .    
     . 
       .      
        
   [13.10]    [13.8].  , 
        
  ,     
 . 
          ( ,   
    ). 
             ( 
,       ). 
           ,   
  . 
            . 
        .     
      [13.10].   
    ,      
  ,         
 (. 24.2).  ,     
  : 
     .. 

    . 24.2.      

        BEGIN TRANSACTION    
  (..     ,  
  BEGIN TRANSACTION      ). 
        COMMIT TRANSACTION    
   (    ). 
        ( )  . RACK TRANSACTION  
          ( 
     ). 

     24,   -  637 


      

             
   (,     
  ).      
   ,    - 
     .    
-      , 
         . 
     [24.3]   ORION,    
- ,      
  . 
         . 
    1.    : 
       ; 
       ; 
       ; 
           ; 
         ; 
         . 
    2.   : 
      ; 
      ; 
      ; 
       ; 
        . 
          (  ): 
            ; 
            . 
         : 
       (  ); 
       (  ); 
      ; 
      ; 
      . 
        "- " 
  ,    ,     
    .     
        - 
,   -    
 .    ,      
      (),    
          . 

      

             
- .    
 (     )   
  

    638	 VI. -  

   ,     
    ,    
   . 
      ,     
,   : 
       .     18,   
  ,    ,    
     .  
-    (   
,         ) 
          
    .  ,  , 
          . 
       .   , -  
     /,    
""             
        . ,   
           
 . 
               
     ( ,   
    ).      
,     " "   
    . 
     [22.2]    1   
     ,    
   (      [24.5]).   
  : 
    1.    1000     
    . 
    2.    1000 . 
    3.     (  )   
     . 
     ,   [22.2],   ( 
, ) -       
    ( , )  
 ,   ,      ( 
 "" ).      ,  " 
...         
- . ...     
  ."     
  ,       
      (      
   ). 

    24.3.      

            
  ,   - .  
         
   - . 
      . 
      . 

     24,   - 	639 

    	,  . 
    	 . 
    	 . 

     

     ""   -   
    ,     
  .        . 
    1.	  - (  "ISA"). 
    2.	  --. 
    3.	  --. 
    
      . 
    1.    -    , 
    

    . . .   RECTANGLE ISA   (   POLYGON  }    ... 

    (    ,   
 22). 
    2.    --     
,     

    ... DEPT ... ( ... EMPS REF ( SET ( REF (  ))))..., 

        " ",    . 
    3.    --       
  ,       "" 
  (       ),   
  " ". 

      

          .    
        
  (       )     
 DEPT    EMPS,   
   ,         
  EDEPT,    : 

    ... DEPT ... ( ... EMPS REF ( SET ( REF (  ) ) ) 
    INVERSE .EDEPT ) ... ...   ... ( ... EDEPT REF ( DEPT ) INVERSE 
DEPT.EMPS ) ... 

      EDEPT     EMPS  
 . ,      
,          ( 
 ,      - ). 
          --,   
    --. 

    ... S ... ( ... PARTS REF ( SET ( REF ( P ) ) ) 
    INVERSE P.SUPPS ) ... ... P ... ( ... SUPPS REF ( SET ( REF ( S ) ) ) 
    INVERSE S.PARTS ) ... 

            . 

    640	 VI. -  

        :   - 
       , 
  ,   ?  (..  
)    , ,    
 SPJ.          
   ,    
 .  ,      
        ""    
 ,  ,         
  ? 
     ,    ,     
       ? , - 
    

    SP.P# WHERE SP.S# = 'SI' SP.S# WHERE SP.P# = 'PI' 

      : 

    S.PARTS.P# WHERE S.S# = 'SI' P.SUPPS.S# WHERE P.P# = 'PI' 

    (    ,   
 ,       ). 

        

         -  
   .       
; ,     ,   
  (Cattell) [22.2]. 
         .      
         ( 
         SQL). 
         .      
  ,    ,       
   (.. ,    ,   
"    "),        
 OPAL.    ,     ( 
  )    (DELETE CASCADES)  
""  (DELETE RESTRICTED)     
     . 
       .        
  (,     nil  
   .)        
 DELETE NULLIFIES,    . 
      " ".    DELETE CASCADES 
(    )    
 " ".       
    -     
  , ..   ,  . 

     

          : " 
   20     500 ".  
   16    ,  
   : 

     24.   - 	641 
    21      


    CREATE INTEGRITY RULE C95 
    IF S.STATUS < 20 AND S.S# = SP.S# THEN SP.OTY < 500 ; 

     - , ,    
        .  
       : 
    	 ; 
    	  ; 
    	  ; 
    	     . 
            . 
    1.    , ,     
     . 
    2.      ,         
  ? 
    3.   , ,       
      " 
"      NEW (..  
 )? 
    4.        
       ,       
"   " , 
        (,      
 ),      ""? 
    5.           
    ,     ? 
    6.       ,      
  ? 
    7.        (  
) ? 
    8.      ,      
  ? 
    9.           
      -  ? 
    10.      (..   
    ,      18)? 
     ,       
         
  ? 
    ( ,    SQL/92 [8.1]   
  ,      
-  -  , -,   
.      - 
   .) 

    .    ,    
   ,      
    "" .   
-      
 .   ,    
   .  ,   
       ,   [22.12] 
,  "   -    
     ...". 

    642	 VI, -  

    , -   " 
"   ,       
  (.. ).      , 
   -    
 ,     .  
,  " "     
, ..   ,   ,     
. ,     , 
  ,     - 
  ,         
  . 

    ,   

          23    " 
,       ",  \\  
. ,         . 
    (  EMPLOYEE    
COURSE)    7        
  ? 
          .   
          
,     .     
       . 
  (,  NEW)       
     ,  , ,   , 
     . 
           .    
    ?    ,   
    ,      
 (..    )   . 
(         GET  SET.) 
            
    , ( 
,      - ,    
       
.) ,          
        , 
   ? 
      ,        
    "- ". 
 ,          ,  
      . 

      

        ,   - 
       
 (    ad hoc).   22 ,  
        , 
   (   ) , 
        . 
,    DEPT    HIRE_EMP ( 
), FIRE_EMP ( ), CUT_BUDGET ( ),  
   ,  "   ()  
",   . 

     24,   - 	643 

       ,   ,  
   .       
     ,   
: 
    1.      ""   
  .        
   () ,   ,   
    . 
    2.         , 
      . 
    ,    POINT     
() LINESEG. ,   -  jy- ,    
       GET,    
      .  , 
,      ,   
  .        
     , : 
    	  ,     (0,0). 
    	    . 
    	     . 
     :    ,    
         
MIDPOINT,  LENGTH   SLOPE,      
  R  . 
       : 
    1.        GET,   
     SET. 
    2.           
. ,    POINT      GET_x 
 GET_y,    GET_r  GET_9,      
  ,    .  , 
  ,        ,  
    9.    ,      
 ,          
  . ( ,     
        (,)  (, 6), 
    .) 

    .   ,        
 GET  SET.   ,   - (.. 
  NEW  -   )    
  ,    -  
  .  ,      
  ,    .. 

      

         ,  
, ,    . 
       .      
- ? 

    644	 VI. -  

      -    
()  : ,   AGE 
()       BIRTHDATE ( 
).        . 
.           
    25   [24.1],    
      - . 
      .         
- ?   -   
 ? 
     ,       
  -   .   
       , ..   
 ,       , 
 ,    .. - 
, ,       
   ,   ,       " 
" (   ,    
..),      (..  
   )         
,  ,         
       .  
,         
   . ,       
    /     
 . 
       .      
      (.  20).   
  - ,      
 ,          
      .     
  : "   nil   ?" [22.12]. 
      .   -  
     ? 

    24.4.  

       ,     . 
        .     
 -   ,      
          
 ,         
  . , - 
  , ,  ,   ,  
      . 
      .        ,  
          
    . 
        .  - 
    ,     .   
        

     24,   - 	645 

 .        
        . 
        ,       
  . ,      
  - ,       
 .  ,  "- "   
  ,   -  
    . 
       . ,   
       
- .    , 
  ,   ,   
    .     
   1. 
      .  ""  -   
         , 
   .       
-, --, --.  ,  
        
   :   ,   
 ,       " 
". ,   ,      
    . 
       .      
-      
 (  ),   . 
       ,  .  ,    
         
- .     ,  
         . 
    ,       
        
         . 
        .      
 -     
.         
    (   GET). 
      . ,      
  , ,    
.  ,    - 
  ,    ,     
      ,  - 
, ,       
   . 
           . 
   ,        
 . ,   , -  
  ,  ,     
 (   )    

    646	 VI. -  

    .     
" " , ,  ,  
 ,        
   . ,   
       ,    : 
    1.           . 
    2.          : 
           ; 
        . 
    ,         
,         
    "- ". 
             , 
 ,   ,      
-      . 

     

    24.1.       !     
    24.2.        ? 
    24.3.          
 . 
    24.4.   ,    
,      .   ,   
   - ?   . 
    24.5.  -    
 , ..   ,    
    ,   , 
        
?        ? 
    24.6.     . 
    24.7.    ,    . 
         
 ?    ? 
    24.8.           
 ? 
    24.9.     - . 
      ?   
    ?  ,  ?   ,   
,  ,   SQL?        
?  ,        
     ?     
    ?     
   ?    ?  
  ?       
?  ,     (,     
 )?     ? 

     24,   - 	647 


      

       ,     
   22  23. 
    24.1. Abiteboul S., Bonner A. Objects and Views // Proc. ACM Intern. Conf. 
on Management of Data.  Denver, Colo., 1991. 
           
- .        
  . 
    24.2. Atkinson M.P., Buneman O.P. Types and Persistence in Database 
Programming Languages // ACM . Surv.  1987.  19,  2. 
              
  . 
    24.3. Banerjee J. et al. Data Model Issues for Object-Oriented 
Applications // ACM TODS.  1987.  5,  1. (     
. Stonebraker (ed.). Readings in Database Systems.  San Mateo, Calif.: 
Morgan Kaufmann, 1988,    [22.16].) 
    24.4. Bjornerstedt A., Hulten C. Version Control in an Object-Oriented 
Architecture. (  [22.9].) 
    24.5. Cattell R.G.G., Skeen J. Object Operations Benchmark // ACM TODS.  
1992.17,  1. 
    24.6. Ellis M.A., Stroustrup B. The Annotated C++ Reference Manual.  
Reading, Mass.: Addison-Wesley, 1990. 
    24.7. Jagadish H.V., Xiaolei Q. Integrity Maintenance in an 
Object-Oriented Database // Proc 18th Intern. Conf. on Very Large Data Bases. 
 Vancouver, Canada, 1992. 
            
 - .   ,   
         . 
    24.8. Katz R.H., Chang E. Managing Change in a Computer-Aided Design 
Database // Proc. 13th Intern. Conf. on Very Large Data Bases.  Brighton, UK, 1987. 
    24.9. Roddick J.F. Schema Evolution in Database Systems  An Annotated 
Bibliography //ACM SIGMOD.  1992.  Record21, 4. 
    24.10. Stroustrup    B.    The    C++    Programming    Language.     
Reading,    Mass.: Addison-Wesley, 1986. 

        

    24.3.  ,       
     ,   [21.14]. 
    1.           
  (      ,  
  ,    ; ..  
 ,  ,       
).        , 
           . 
    2.          
 . 

    648	 VI. -  


             
 . 
              
   ,      
.  , ,     
 (         
 ).        
        
 . 
    24.4.   ,    , 
  : ,     
  .         
      ;  ,  
    - .   ,  
         
 (     - ) 
    ,    
 . 

    .  ,     ,  
  ,   ,     
- . 

    24.5.   ,  ,   ,  
   (  ,      
 ).  ,   , 
      .    
    ,  
 ,     .. 

     24.   - 	649 

