MODEL MASTER
AN OBJECT-ORIENTED SPREADSHEET FRONT-END

Making spreadsheets safer

Contents Previous Next

MM company example - adding behaviour via inheritance

Now we shall make a specific company named bogo_rexx, by giving some initial values.

object company
    attributes
        incomings : real
        outgoings : real
        profit    : real
    where
        profit[t] = incomings[t] - outgoings[t].

object bogo_rexx is_a company
    where
        incomings[0] = 10000 &
        (t>0) incomings[t] = incomings[t-1]*1.1 &
        outgoings[0] = 5000 &
        (t>0) outgoings[t] = outgoings[t-1]*1.5.

bogo_rexx reuses code from company, and adds some extra formulae.

 


Contents Previous Next

Copyright © 1998 J Ireson-Paine. All rights reserved