Unformatted text preview:

1Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 610AccountsFramework for BusinessTransaction ProcessingA Case StudyObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 611Framework for InvestingWard Cunningham: framework forsecurities trading• • portfolio -- collection of instruments• • instrument -- stock, bond, cash fund• • transactions2Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 612Another ExampleAccounting at a store• • journal -- collection of accounts• • account -- inventory, accounts payable(vender)• • transactionsObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 613SimilaritiesStore• journal• account• transactionsInvestment• portfolio• instrument• transactionsTransactions are similar, and instrumentand account are similar.3Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 614DifferencesEach journal defines a new kind ofaccount, and all accounts in a journalare the same.The same kind of instruments appear inevery portfolio, and a single portfoliohas many kinds of instruments.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 615Business Transaction FrameworkAccount• List of transactions• Attributes are functions of trans.Transactions• A record with a date.• Paper forms4Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 616AccountsList of transactionsAttributes are functions of trans.Vender accountEmployee accountInventory accountBank accountObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 617TransactionsA record with a date.Paper formsInvoice / purchase orderPaycheck / timecardInvoice / sales transactionWithdrawal / deposit / interest5Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 618An Inventory AccountAn invoice for a purchase increasesinventory and increases amount owedto vender.A sales transaction decreases inventoryand increases amount sold to date.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 619Inventory #384on hand sold purchstart 30 100 30sales #6 (4)26 104 30sales #8 (1)25 105 30sales #13 (2)23 107 30invoice #5 (50) 73 107 80sales #24 (1)72 108 806TransactionsRecords withdates, some ofwhose fields aremultivaluedObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 621Transactions and AccountsInventory (IJ) JournalGeneral Ledger (GL)Accounts Payable Journal (APJ)Sales (SJ) JournalSalesOverShort SalesTransactionsInvoiceShrinkageVenderPayment PayablesAdjustment GeneralLedger TransactionRectangles are kind of Transaction.Ovals are journals, contain Accounts.7Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 622AttributesEach account has a set of attributes.An attribute can be:• • total of a field taken from thetransactions• • month-to-date, year-to-date, etc• • function of other attributes, e.g.inventory on hand is total purchased -total sold - shrinkage.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 623AttributesEach attribute has a name(SalesMonthToDate).An attribute is time-dependent, i.e.reading an attribute always requiresspecifying a time.8Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 624First Version of AccountsAccounts are responsible for• • computing value of attributes• • keeping track of transactionsTransactions are responsible for• • knowing the accounts that they areposted toObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 625First version of AccountsAccountInventoryAccountPayableAccount...BondCash...Transaction• Invoice• SalesTransaction• ...• Purchase• InterestPayment• ...9Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 626How to use Accounts V1White-box framework --- use bysubclassingDetermine the kinds of accounts andtransactions.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 627How to use Accounts V1For each kind of account, make asubclass of Account.Define a method for for computing eachattribute. It must access transactions.10Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 628How to use Accounts V1For each kind of transaction, make asubclass of Transaction.• Define a method that returns theaccounts to which the transactionshould be posted.• Define methods that attributes use toaccess transaction.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 629Inventory and Accounts PayableFirst a purchase order is sent to avender. The vender sends back thegoods, supposedly with an invoice,though sometimes the invoice comesseparately. The receiving departmentchecks that all the goods arrived asstated on the invoice.11Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 630Payment is sent to the vender when it isdue. The goods are put on theshelves, where they are sold. When theinventory is low again, anotherpurchase order is written.Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 631Create Accounts and TransactionsTransactions:• Invoice, PurchaseOrder,SalesTransaction, VendorPayment,Shrinkage, PayablesAdjustment• Accounts• InventoryAccount, VendorAccount12Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 632Define the Account to which a Transaction is postedInventory (IJ) JournalAccounts Payable Journal (APJ)SalesTransactionsInvoiceShrinkageVendorPayment PayablesAdjustmentPurchaseOrderObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 633Define fields on transactionsInvoice has:• • date• • vendor• • due date• • list of (inventory item, claimedquantity, actual quantity, price)• • discount• • total13Object-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 634Define attributes on accountsInventory has total received, total sold,total ordered, on-hand• • define method for each attribute thatsends message to transactions• • for each Transaction posting to anAccount, define method to respond tomessage sent by attributeObject-oriented Programming and Design - Copyright 1998 by Ralph E. Johnson 635InventoryInventory has total received, total sold,total ordered, on-hand• • define way


View Full Document

UIUC CS 497 - Accounts

Download Accounts
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Accounts and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Accounts 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?