Microsoft Word OpenIssuesInOO. doc



Download 1.28 Mb.
Pdf ko'rish
bet14/51
Sana29.08.2021
Hajmi1.28 Mb.
1   ...   10   11   12   13   14   15   16   17   ...   51
4. Abstraction 

mechanisms 


In the following examples, BETA is used as a reference language. One of the unique 

characteristics of BETA is that abstraction mechanisms such as class, procedure, function, 

control abstractions, process type, exception type, etc, have been unified into one single 

abstraction mechanisms called pattern. By abstraction mechanism we mean any language 

construct that describe the structure of a set of entities and may be used to instantiate such 

entities. A class describe the structure of objects and may be used to instantiate objects; a 

procedure describe the structure of procedure activations and may be used to instantiate 

procedure activations, etc.  The following is a simple example of BETA patterns: 

Account: 

   (# balance: @integer; 

      deposit: 

         (# amount: @integer 

         enter amount 

         do balance + amount -> balance 

         exit balance 

         #); 

       withdraw: (# ... #) 

   #) 


The pattern Account describes objects that have 3 attributes: balance,  deposit and 

withdraw.  Balance is a simple integer variable. Deposit and Withdraw are 

patterns. In this example Account corresponds to a class and is called a class pattern

whereas  deposit and withdraw corresponds to procedures and are called procedure 



patterns. The enter-part (enter amount) describes the input parameter, and the exit-part 

(exit balance) describes the output parameter of deposit. If myAccount refers to 

an instance of Account, then the following imperative makes a deposit of 500 and returns 

the new balance in currentBalance 

500 -> myAccount.deposit -> currentBalance 


Download 1.28 Mb.

Do'stlaringiz bilan baham:
1   ...   10   11   12   13   14   15   16   17   ...   51




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2020
ma'muriyatiga murojaat qiling

    Bosh sahifa
davlat universiteti
ta’lim vazirligi
maxsus ta’lim
O’zbekiston respublikasi
zbekiston respublikasi
axborot texnologiyalari
o’rta maxsus
guruh talabasi
nomidagi toshkent
davlat pedagogika
texnologiyalari universiteti
xorazmiy nomidagi
toshkent axborot
pedagogika instituti
haqida tushuncha
rivojlantirish vazirligi
toshkent davlat
Toshkent davlat
vazirligi toshkent
tashkil etish
matematika fakulteti
ta’limi vazirligi
samarqand davlat
kommunikatsiyalarini rivojlantirish
bilan ishlash
pedagogika universiteti
vazirligi muhammad
fanining predmeti
Darsning maqsadi
o’rta ta’lim
navoiy nomidagi
haqida umumiy
Ishdan maqsad
moliya instituti
fizika matematika
nomidagi samarqand
sinflar uchun
fanlar fakulteti
Nizomiy nomidagi
maxsus ta'lim
Ўзбекистон республикаси
ta'lim vazirligi
universiteti fizika
umumiy o’rta
Referat mavzu
respublikasi axborot
таълим вазирлиги
Alisher navoiy
махсус таълим
Toshkent axborot
Buxoro davlat