27
Patterns in Software Engineering Lecturer: Raman Ramsin Lecture 18 Analysis Patterns Part 1 Department of Computer Engineering 1 Sharif University of Technology Part 1

Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

  • Upload
    others

  • View
    2

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering

Lecturer: Raman Ramsin

Lecture 18

Analysis PatternsPart 1

Department of Computer Engineering1

Sharif University of Technology

Part 1

Page 2: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis PatternsAnalysis Patterns

First introduced by Fowler in 1997.

“Analysis patterns are groups of concepts that represent aAnalysis patterns are groups of concepts that represent a common construction in business modeling.“

An analysis pattern may be relevant to only one domain or it may spanAn analysis pattern may be relevant to only one domain, or it may span many domains.

Department of Computer Engineering2

Sharif University of Technology

Page 3: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: CategoriesAnalysis Patterns: Categories

Accountability: Patterns for describing relationships that defineAccountability: Patterns for describing relationships that define responsibilities between parties.

Observations and Measurements: Patterns for recording factsObservations and Measurements: Patterns for recording facts.

Referring to Objects: Patterns of indexing to refer exactly to objects.

Inventory and Accounting: Basic patterns for accounting, describing how a network of accounts can form an active accounting system.

Planning: Patterns depicting the relationship between standard plans and one-off plans, and how to plan and record the use of resources.

di f d h fl d dTrading: Patterns focusing on trading in situations where prices are fluid and we need to understand how these price changes affect the profits.

Department of Computer Engineering3

Sharif University of Technology

Page 4: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Supporting PatternsSupporting Patterns

Fowler also provides several supporting patterns, which p pp g p ,describe how to take analysis patterns and apply them:

Layered Architecture for Information SystemsLayered Architecture for Information Systems

Patterns for Type Model Design Templates

Association Patterns

Department of Computer Engineering4

Sharif University of Technology

Page 5: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Accountability - PartyAnalysis Patterns: Accountability Party

Problem: People and organizational units have similar responsibilities.

Solution: Create a type party as a supertype of person and organization.

Department of Computer Engineering5

Sharif University of Technology

Page 6: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Accountability - PartyAnalysis Patterns: Accountability Party

Department of Computer Engineering6

Sharif University of Technology

Page 7: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Accountability - AccountabilityAnalysis Patterns: Accountability Accountability

Problem: Representing organization structures employmentProblem: Representing organization structures, employment, management, professional registration, and contracts with a similar structure.

Solution: Create accountability as a directed relationshipSolution: Create accountability as a directed relationship between two parties.

Give it an accountability type to represent the kind of relationship.y yp p p

Department of Computer Engineering7

Sharif University of Technology

Page 8: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Accountability - AccountabilityAnalysis Patterns: Accountability Accountability

Department of Computer Engineering8

Sharif University of Technology

Page 9: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - QuantityAnalysis Patterns: Observations and Measurements Quantity

P bl R ti l h 6 f t $5Problem: Representing a value such as 6 feet or $5.

Solution: Use a quantity type that includes both the amount and the unit.

C i ki d f itCurrencies are a kind of unit.

Department of Computer Engineering9

Sharif University of Technology

Page 10: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - QuantityAnalysis Patterns: Observations and Measurements Quantity

Department of Computer Engineering10

Sharif University of Technology

Page 11: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - MeasurementAnalysis Patterns: Observations and Measurements Measurement

Problem: An object has a large number of quantity attributesAn object has a large number of quantity attributes.Recording information about an individual measurement of an attribute.Tracking changes in a value to an attribute over time.

Solution: Create an object to represent the individualSolution: Create an object to represent the individual measurement.

This is linked to the object being measured and to a phenomenon type that describes the kind of measurement being made.

Department of Computer Engineering11

Sharif University of Technology

Page 12: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - MeasurementAnalysis Patterns: Observations and Measurements Measurement

Department of Computer Engineering12

Sharif University of Technology

Page 13: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - ObservationAnalysis Patterns: Observations and Measurements Observation

Problem: Attributes are qualitative and thus cannot beProblem: Attributes are qualitative and thus cannot be measured with numbers.

Solution: Create an observation type that links the object to a phenomenonphenomenon.

Each phenomenon is a value for some phenomenon type.

Department of Computer Engineering13

Sharif University of Technology

Page 14: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Observations and Measurements - ObservationAnalysis Patterns: Observations and Measurements Observation

Department of Computer Engineering14

Sharif University of Technology

Page 15: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Referring to Objects - Identification Schemey g j

Problem: Ensuring an identification refers to only one objectProblem: Ensuring an identification refers to only one object but different parties can refer to the object differently.

Solution: Create identification schemes that contain identifiers, where each identifier refers to only one unitwhere each identifier refers to only one unit.

A party can use any identification scheme.

Department of Computer Engineering15

Sharif University of Technology

Page 16: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Referring to Objects - Identification Schemey g j

Department of Computer Engineering16

Sharif University of Technology

Page 17: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Inventory and Accounting - Accounty y g

Problem: Recording a history of changes to some quantity.

Solution: Create an account. Each change is recorded as an entry against the account.

The balance of the account gives its current value.

Department of Computer Engineering17

Sharif University of Technology

Page 18: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Inventory and Accounting - Accounty y g

Department of Computer Engineering18

Sharif University of Technology

Page 19: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Inventory and Accounting - Transactiony y g

Problem: Ensuring that nothing gets lost from an account.

Solution: Use transactions to transfer items between accounts.

Department of Computer Engineering19

Sharif University of Technology

Page 20: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Inventory and Accounting - Transactiony y g

Department of Computer Engineering20

Sharif University of Technology

Page 21: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Planning - Proposed and Implemented Actiony g p p

P bl R ti b th h t i t d d t d d h tProblem: Representing both what you intended to do and what you did.

Solution: Use separate objects for the proposed and implemented actionsimplemented actions.

Department of Computer Engineering21

Sharif University of Technology

Page 22: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Planning - Proposed and Implemented Actiony g p p

Department of Computer Engineering22

Sharif University of Technology

Page 23: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Planning - Plany g

Problem:Problem: Recording a group of proposed actions that you intend to perform together.gRepresenting the dependencies among actions.Allowing different people to coordinate each other's plans.

Solution: A plan is a collection of proposed actions linked by dependencies.

Several parties can have different plans that refer to the same proposed actionaction.Use separate objects for the proposed and implemented actions.

Department of Computer Engineering23

Sharif University of Technology

Page 24: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Planning - Plany g

Department of Computer Engineering24

Sharif University of Technology

Page 25: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Trading - Contracty g

Problem: Recording deals from the perspective of both the buyer and the seller.

Solution: Use a contractor with both buying and selling parties.

Department of Computer Engineering25

Sharif University of Technology

Page 26: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

Analysis Patterns: Trading - Contracty g

Department of Computer Engineering26

Sharif University of Technology

Page 27: Patterns in Software Engineeringsharif.edu/~ramsin/index_files/pselecture18.pdf · 2008-06-02 · Patterns in Software Engineering – Lecture 18 Analysis Patterns:Analysis Patterns:

Patterns in Software Engineering – Lecture 18

R fReference

Fowler, M., Analysis Patterns: Reusable Object Models, Addison-Wesley, 1997.

Department of Computer Engineering27

Sharif University of Technology