Analysis Patterns For UML Diagrams

Document Sample
Analysis Patterns For UML Diagrams Powered By Docstoc
					UML Diagrams for Chapter 6 of Analysis
Patterns
Drawn by Jennifer Hansen, checked formatted by Martin Fowler

Jennifer drew up the following diagrams into UML. As with all the others, my
sincere thanks to her for her efforts.

However, for this chapter, remember that there is a more up to date discussion of
patterns in accounting at http://martinfowler.com/apsupp/accounting.pdf The
patterns there supercede the patterns in the Analysis Patterns book

Figure 6.1

  Constraint:
  balance=sum(entries.amount)




                                                       Entry
           Account         1           *
                                           amount: Quantity
       balance: Quantity                   whenCharged: Timepoint
                                           whenBooked: Timepoint




Figure 6.2

                   1            *          Entry           2        1
    Account                                                              Transaction
                                    amount: Quantity




                                                                    Constraint:
                                                                    Sum(entries.amount) = 0
Figure 6.3

                      1                 *               Entry              2..*                  1
     Account                                                                                              Transaction
                                                amount: Quantity




                                                                                                 Constraint:
                                                                                                 Sum(entries.amount) = 0


Figure 6.4

 Derivation:
 = sum(withdrawals)
 - sum(deposits)

                                    1                            1
                                                  Quantity



                                balance                                                          amount

                           *                                                                 *
                                            1          withdrawal from      *
                                                                                                           *            1
                          Account           1                               *       Transaction                              Timepoint

                                                         deposit to




Figure 6.5

   components
   {hierarchy}
                      *
                               Account




                                                                                                     entries
                                                                                                     {abstract}
                                                                                         *

    0..1                                                         1              *                              2..*     1
               Summary
                                                Detail Account                           Entry *                            Transaction
               Account
                                                                      entries




    Overload: Entries is devived
    as components. entries
Figure 6.6


                                    Derivation:
                                    = entries AND components.entries




                                          allEntries                *

       Account              1                                       *           Entry

                                          baseEntries
 *                   0..1



      components
      {hierarchy}


Figure 6.7

                            1              *                            *           1
       Account                                     Posting Rule                                 Number
                            trigger                                         multiplier

       1       output                                    *




Figure 6.8

                            *                        1
     Posting Rule                                               Method
                                           calculation



Figure 6.9

                            1                  *         State Tax PR
           State
                                                   calculateFor()




                        MA Tax        1                      CA Tax     1                     NY Tax      1

                   calculateFor()                      calculateFor()                    calculateFor()
Figure 6.10

                   1                  *         State Tax PR                                     Method:
     State                                                                                       calculation
                                          calculateFor()                                         method.calculateFor()

                                                     *     calculation
                                                           method
                                                     1

                                                   Method

                                          calculateFor()




                                                                                             1
                  MA Tax 1                         CA Tax 1                      NY Tax

             calculateFor()                   calculateFor()                calculateFor()



Figure 6.12

                                                State Tax PR                    Method:
                    1             *                                             Case (State)
     State                                + calculateFor()                      MA: calcMA()
                                          - calcMA()                            CA: calcCA()
                                          - calcCA()                            ...




Figure 6.13

                                            State Tax PR
                    1         *                                  *          1
     State                                                                           Number
                                          calculateFor()             rate




                                                Method:
                                                multiply by rate
Figure 6.20
                                      1         *                      *
                     Account
                                                        Posting Rule
                      Type            trigger

                 1        1     output                     *




                                                                           knowledge

                                                                           operational


                 *

                                      *         1
                     Employee
                                                         Employee
                      Account



Figure 6.21
                     *                    1
  Posting Rule                                      Method
                                 calculation

      *                                             1

              account finder



Figure 6.23

              eligibility condition



     *                                              1
                     *                    1
  Posting Rule                                      Method
                                 calculation

      *                                             1

              account finder



Figure 6.25

                     *                    *
                                                Accounting
  Posting Rule
                                                 Practice
Figure 6.26

                                             Accounting
                                            Practice Type

                                                   1



                                                   *

                  *                 *                           1
                                             Accounting                            accounting
  Posting Rule                                                                                   Object
                                              Practice                   users   practice type




Figure 6.27


                                             Posting Rule


                                              0..1
                                        creator


                                               *

                  *                 1
     Entry                                   Transaction


        *                                              *


                                        sources
        consequences



Figure 6.28


                                           Account




                                                                     Income
             Balance Sheet
                                                                    Statement
                Account
                                                                     Account




                                                                                 Expense
 Asset Account         Liability Account               Income Account
                                                                                 Account
Figure 6.29

                   correspondents {symmetric, transitive}


               *             *

                                    *                              1
                   Account                                                   Party
                                                      classifier

                                                                             1     owner




    Income                                        *
                                 Balance Sheet
   Statement
                                    Account
    Account




Figure 6.30

                                                                                                 Constraint:
                                                                                                 Sum(entries.amount)==0




                                                      1            *             Entry        2..*         1
                                        Account                                                                   Transaction
                                                                       amount: Quantity




                   1         *
    Location                            Holding                        Inventory Entry                              Transfer


                                          *                                         *


                                                                                                      Constraint:
                                                      Item Type                                       all entry.item types are
                                              1                          1
                                                                                                      the same


                                                                                  Constraint:
                                                                                  self.item type ==
                                                                                  self.account.item
Figure 6.32

                         *       Account                             *                          2..*        1
                                                                              Entry                               Transaction
                             balance: Quantity       entries {abstract}
                                                                                   entrie
                                                                              *
                                                                                   s




                  Summary                                       1
                                              Detail Account
                  Account
              *
components
{DAG}

                  Overload:
                  entries is derived as
                  components.entries



Figure 6.34
                                 Overload:
                                 entries = all e:entries for which
                                 account filter.isIncluded (e) == true




                                                          *               1       Account Filter
    Account                         Derived Account
                                                                              isIncluded()

     1




     *

                                                          *               1
                                                                                    Expense
     Entry                           Expense Entry
                                                                                    Category



Figure 6.34


                                                   Expense
                  0..1                    *                         *                       1
                                                                                                       Expense
     Client                                   amount: Money                                            Category
                                              date: Date

				
DOCUMENT INFO
Description: Analysis Patterns For UML Diagrams