Unformatted text preview:

AccountsFramework for InvestingAnother ExampleSimilaritiesDifferencesBusiness Transaction FrameworkSlide 7TransactionsAn Inventory AccountInventory #384Slide 11Transactions and AccountsAttributesSlide 14First Version of AccountsFirst version of AccountsHow to use Accounts V1Slide 18Slide 19Inventory and Accounts PayableSlide 21Create Accounts and TransactionsSlide 23Define fields on transactionsDefine attributes on accountsInventorySlide 27Slide 28Eliminate Subclassing AccountSecond try:Attributes as a StrategyStrategy PatternDesigning Attribute Class HierarchySlide 34More AttributesSlide 36InterpreterSlide 38valueAt: aDateSlide 40Interpreting Functions of TimeAdvantages of Accounts V2?Disadvantages of Accounts V2Another Look at Accounts and TransactionsSlide 45Simulating M.I. with Compound ObjectsFor AccountsSubdividing a TransactionSlide 49Conservation of ComplexitySubdividing an InvoiceCompositesComposite AccountsCompositeAccountSlide 55Slide 56Other CompositeAccounts?Other CompositeAccountsSlide 59SolutionHeterogenous Composite AccountsAccounts are used as PrototypesAccounts are Used as PrototypesAccounts Framework, V3Slide 65Slide 66How Accounts is a Framework(continued)How to use AccountsDefine Attributes on Accounts.Changing White-box to Black-boxWhite-box to Black-boxInstance DiagramExamplesFinding ExamplesSlide 76What Examples for Accounts?Slide 78AccountsFramework for Business Transaction ProcessingA Case StudyFramework for InvestingWard Cunningham: framework for securities trading• portfolio -- collection of instruments• instrument -- stock, bond, cash fund• transactionsAnother ExampleAccounting at a store• journal -- collection of accounts• account -- inventory, accounts payable (vender)• transactionsSimilaritiesStore• journal• account• transactionsInvestment • portfolio • instrument• transactionsTransactions are similar, and instrument and account are similar.DifferencesEach journal defines a new kind of account, and all accounts in a journal are the same.The same kind of instruments appear in every portfolio, and a single portfolio has many kinds of instruments.Business Transaction FrameworkAccountList of transactionsAttributes are functions of trans.TransactionsA record with a date.Paper formsAccountsList of transactionsAttributes are functions of trans.Vender accountEmployee accountInventory accountBank accountTransactionsA record with a date.Paper formsInvoice / purchase orderPaycheck / timecardInvoice / sales transactionWithdrawal / deposit / interestAn Inventory AccountAn invoice for a purchase increases inventory and increases amount owed to vender.A sales transaction decreases inventory and increases amount sold to date.Inventory #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 80TransactionsRecords with dates, some of whose fields are multivaluedTransactions 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.AttributesEach account has a set of attributes.An attribute can be:• total of a field taken from the transactions• month-to-date, year-to-date, etc• function of other attributes, e.g. inventory on hand is total purchased - total sold - shrinkage.AttributesEach attribute has a name (SalesMonthToDate).An attribute is time-dependent, i.e. reading an attribute always requires specifying a time.First Version of AccountsAccounts are responsible for• computing value of attributes• keeping track of transactionsTransactions are responsible for• knowing the accounts that they are posted toFirst version of AccountsAccountInventoryAccountPayableAccount...BondCash...TransactionInvoiceSalesTransaction...PurchaseInterestPayment...How to use Accounts V1White-box framework --- use by subclassingDetermine the kinds of accounts and transactions.How to use Accounts V1For each kind of account, make a subclass of Account.Define a method for for computing each attribute. It must access transactions.How to use Accounts V1For each kind of transaction, make a subclass of Transaction.• Define a method that returns the accounts to which the transaction should be posted.• Define methods that attributes use to access transaction.Inventory and Accounts PayableFirst a purchase order is sent to a vender. The vender sends back the goods, supposedly with an invoice, though sometimes the invoice comes separately. The receiving department checks that all the goods arrived as stated on the invoice.Payment is sent to the vender when it is due. The goods are put on the shelves, where they are sold. When the inventory is low again, another purchase order is written.Create Accounts and TransactionsTransactions: Invoice, PurchaseOrder, SalesTransaction, VendorPayment, Shrinkage, PayablesAdjustmentAccountsInventoryAccount, VendorAccountDefine the Account to which a Transaction is postedInventory (IJ) JournalAccounts Payable Journal (APJ)SalesTransactionsInvoiceShrinkageVendorPayment PayablesAdjustmentPurchaseOrderDefine fields on transactionsInvoice has:• date• vendor• due date• list of (inventory item, claimed quantity, actual quantity, price)• discount• totalDefine attributes on accountsInventory has total received, total sold, total ordered, on-hand• define method for each attribute that sends message to transactions• for each Transaction posting to an Account, define method to respond to message sent by attributeInventoryInventory has total received, total sold, total ordered, on-hand• define way attribute is computed (+,*, mtd, ytd) "received" uses + and sends #received: to the TransactionsInventory• for each Transaction posting to an Account, define how the attribute gets a value#received: to a PurchaseOrder = 0#received: to a Shrinkage = 0#received: to a SalesTrasaction = 0Inventory#received: to an InvoiceLook up inventory number in the Invoice, and return the "actual quantity".(InventoryAccount is argument to #received:, and each InventoryAccount knows its inventory number.)Eliminate Subclassing AccountMain difference between Accounts is their attributes.First try:Attribute is operation on Account.Capture commonality by decomposing attributes and reusing pieces.Second


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?