Condor.depaul.edu



Analyzing Requirements

|Focus of Analysis |Diagrams |

|Processes |Data Flow, State chart |

|Data |Entity Relationship |

|Objects |Structural |

| |Class, Object, Component, Deployment |

| | |

| |Behavioral |

| |Use Case, Sequence, Collaboration, State chart, Activity |

Object-oriented Analysis

Decompose a problem by selecting relevant concepts

from the vocabulary of the domain.

Concept

• A category of ideas or things (often a synonym for Type).

• A concept should have a clear definition (intension). The definition can be tested against other objects to see if they belong to the same class (extension).

• Diagramaticalliy, concept names are noun phrases with every word capitalized shown in the top section of a class symbol.

• Do not need operations

• May show responsibilities.

Conceptual Model

▪ Used during analysis to show important real-world concepts, attributes and associations in the vocabulary of the problem domain

▪ concepts include (objects, roles, events, interactions)

• becomes a foundation for the class model

▪ Software design will add responsibilities, operations, and methods.

Essential Description

real-world things and concepts related to the problem domain that the system is being designed to solve without reference to implementation technology.

Total conceptual model

all significant real-world concepts in the problem domain.

Minimal conceptual model,

concepts relevant to the use case being developed.

Early in the analysis process, build a conceptual model

that accurately represents real abstractions of the problem domain.

A conceptual model can be created

• shortly after gathering Use Cases

• or concurrently with the definition of Use Cases

Sources for concepts and classes

▪ High level problem statement

▪ Lower-level requirements

▪ Expert knowledge of the problem space.

Strategies for finding domain concepts

• Consultation with domain experts (for their conceptual understanding)

▪ Grammatical parsing for noun and verb phrases

▪ Nouns and noun phrases become objects and attributes

▪ Verbs and verb phrases become operations and associations.

▪ Possessive phrases indicate that nouns may be attributes rather than objects

• Try using the Concept Check List (Larman)

|Concept Check List (Larman) pp. 92 - 93 |Examples |

|Physical objects |POST, Airplane |

|Specifications, designs or descriptions of things |ProductSpecifications, FlightDescription |

|Places |Store |

| |Airport |

|Transactions |ObjectsSale, Payment, Reservation |

|Transaction line items |SalesLineItem |

|Roles |Cashier, Pilot |

|Containers of other things |Store, Bin |

| |Airplane |

|Things in a container |Item, Passenger |

|External Computer Systems or devices |CreditCardAuthorizationSystem, AirTrafficControl |

|Abstract noun concepts |Hunger, Acrophobia |

|Organizations |SalesDepartment, |

|Events |Sale, Robbery, Meeting |

| |Flight, Crash, Landing |

|Processes |SellingAProduct |

| |BookingASeat |

|Rules and policies |RefundPolicy |

| |CancellationPolicy |

|Catalogs |ProductCatalog |

| |PartsCatalog |

|Records of finance, work, contracts, legal matters |Receipt, Ledger, EmploymentContract |

| |MaintenanceLog |

|Financial instruments and services |LineOfCredit |

| |Stock |

|Manuals, books |EmployeeManual |

| |RepairManual |

Strategy for creating a map (mapmaker)

• Use existing names of the territory

• Exclude irrelevant features (add noise)

• Do not add things that do not exist in the territory

Strategy for creating a conceptual model

• List the candidate concepts

• Draw them in a model

• Add needed associations

• Add needed attributes

Class

Set of objects that share the same attributes, operations, methods, relationships and semantics.

Class names are noun phrases with every word capitalized.

Attribute

A property that is shared by all objects of a given type

Shown in the second section of a rectangular box representing a concept or class

Distinguish Attributes from Concepts

▪ Attributes and associations are similar.

▪ Attributes are usually single-valued, simple data types

▪ Concepts are multi-valued and complex.

Attribute name

Attribute names are noun phrases.

Every word of the attribute name is capitalized, except the first.

Full notation form for an attribute is:

visibility-symbol attribute-name [ multiplicity ] : type-expression = initial-value { property-string }

Examples:

+date : Date = Current date {frozen}

#amount : Real

-beneficiary[0..1] : String = “Unspecified”

visibility-symbol attribute-name [ multiplicity ] : type-expression = initial-value { property-string }

Visibility -- determines whether a feature (attribute or operation) can be used by others

|Symbol |Category |Can be used by: |

|+ |Public |Any other class |

|# |Protected |Descendants only |

|- |Private |None other |

Features without a pre-pended symbol are assumed to be public.

Should any attributes be public?

visibility-symbol attribute-name [ multiplicity ] : type-expression = initial-value { property-string }

Multiplicity -- Number of instances of the attribute within a class

|Multiplicity |Meaning |

|[0..1] |Zero or one -- |

| |Optional attribute |

|[2..*] |Two or more |

| |similar attributes |

visibility-symbol attribute-name [ multiplicity ] : type-expression = initial-value { property-string }

: type-expression = initial value

The data type used to contain the value of an attribute [= initial value] If there is a default value that could be assigned.

Simple Attributes

Level at which there are no useful distinctions for the problem domain

5 vs 5

cat vs cat

Primitive Data Types

Boolean, Date, Number (Real, Integer), String (Text), Time

Non-primitive Data Attributes

• Are composed of separate sections

• have parsing operations

• have other attributes

• is a quantity with a unit

visibility-symbol attribute-name [ multiplicity ] : type-expression = initial-value { property-string }

property-string

|property-string |Meaning |

|(attributes) | |

|changeable |No restrictions on modifying the attributes value |

|addOnly |For attributes with multiplicity > 1, can add additional values but not remove or alter|

| |values that exist |

|frozen |Attribute’s value may not be changed after the object is initialized |

Derived Attributes -- are pre-pended with a slash (/) ----- /age

Class-scope Attribute -- is shown by underlining the name and type expression string;

usageCount

Avoid using foreign keys as attributes to relate concepts.

foreign keys are a design issue

use associations during problem analysis

Attributes in the conceptual model should be there to satisfy requirements.

(otherwise -- why are they there)

A sales receipt normally includes date and time, therefore a Sales concept

needs a date and time attribute.

Operation

A service that the object can perform

Shown in the third section of a rectangular box representing a concept or class

Operation’s signature -- name of an operation plus its parameters and return type

Full form syntax of an attribute is:

visibility-symbol operation- name ( parameter-list ) : return-type-expression { property-string }

visibility-symbol operation-name ( parameter-list ) : return-type-expression { property-string }

Operation name -- are verb phrases usually followed by ()

visibility name ( parameter-list ) : return-type-expression { property-string }

Every word of name capitalized, except the first

visibility-symbol operation-name ( parameter-list ) : return-type-expression { property-string }

Visibility -- Same symbols and meaning as class attributes

Question. Should there be getAttribute() and setAttribute() operations for every attribute that a class contains?

visibility-symbol operation- name ( parameter-list ) : return-type-expression { property-string }

parameter-list -- Zero or more parameters separated by commas

ex. (n : Name, s : String)

Each parameter has the syntax: kind name : type-expression = default-value

• kind is in, out, or inout, with the default in if absent.

• name is the name of a formal parameter.

• type-expression is a language-dependent implementation type.

• default-value an optional value expression for the parameter

|Direction |Meaning |

|In |Input parameter, may not be modified by operation |

|Out |Output parameter, modifiable by operation |

|Inout |Input parameter which may be modified by operation |

| | |

visibility-symbol operation-name ( parameter-list ) : return-type-expression { property-string }

return-type-expression --

language-dependent specification of the implementation type returned.

The colon and the return-type are omitted if the operation does not return a value.

visibility-symbol operation-name ( parameter-list ) : return-type-expression { property-string }

property-string

|property-string |Meaning |

|(operations) | |

|Query |No attributes altered |

|Sequential |Callers are responsible for ensuring use by only one object at a time |

|Guarded |The called operation ensures sequencing for use by one object at a time |

|Concurrent |The called operation will correctly handle multiple calls from concurrent flows of |

| |operation |

Class-scope operation --

an operation that applies to a class rather than an instance is shown by underlining the name and type expression string.

An instance-scope operation is the default and is not marked.

incrementUsageCount()

decrementUsageCount()

Association A meaningful and interesting connection between concepts or classes

▪ Name of the association is optional (usually a verb phrase)

▪ Binary associations shown as solid lines connecting two classes.

The end points of an association connect to a class.

End points of associations can have adornments

• multiplicity (how many instances of type A are associated with a single instance of type B at a particular moment in time. A set of non-negative integers. Shown as a comma-separated text string of integer intervals, or a range format of lower-bound .. upper-bound the star character (*) may be used for the upper bound

• role name context of use (purpose of the association) (different than the association name)

• qualifier association attribute that reduces the many side to a subset

------------------------------------------------------------------------------------------------------------------

Associations Imply that

• objects are visible to each other (unless limited by visibility symbol at role name)

• public -- is default

• private -- accessible only to the object of the association

• protected -- accessible to the object of the association and its children

• objects can easily navigate to each other (unless limited by an arrow at one end of the association)

{xor} constraint Only one association, of two or more possibilities, is permitted for a given instance

Types of association --

Aggregation (shared), Composition, Generalization

Aggregation (shared) -- “has-a” “whole/part”

shared -- distinguishes whole from part

A part can be used by several wholes (wall can be part of several rooms)

Shown by open diamond at whole end of association

No change to meaning of navigation nor to lifetimes of whole and its parts.

Composition -- the whole owns its parts

A part can only be in one composition at a time.

If the composite dies, the parts die with it

Whole manages creation and destruction of its parts (window -- frames)

Generalization -- relationship of parent to child (general / specific)

Dependency -- A change in the specification of one object may affect a change in another

A dependency is shown as a dashed arrow between two elements.

The model element at the tail of the arrow (the client) depends on the model element at the arrowhead (the supplier).

The arrow may be labeled with an optional stereotype and an optional individual name.

Association Class

Associations that have attributes need a class to contain the properties.

Shown by a class attached with a broken line to an association.

Is salary a property of the company, the person or the relationship?

|Association Check List | |

|Category |Examples |

|Larman's High-Priority Associations | |

|A is a physical part of B |Drawer -- POST |

|A is a logical part of B |SalesLineItem--Sale |

|A is physically contained in/on B |POST--Store, Item--Shelf |

|A is logically contained in B |ItemDescription--Catalog |

|A is known / logged / reported / recorded / captured in B |Sale -- POST |

|Larman's other useful Associations | |

|A is a description for B |ItemDescription--Item |

|A is a line-item of a transaction or report B |SalesLineItem--Sale |

|A is a member of B |Cashier--Store |

|A is an organizational subunit of B |Department--Store |

|A uses or manages B |Cashier--POST |

|A communicates with B |Customer--Cashier |

|A is related to transaction B |Customer--Payment |

|A is a transaction related to another transaction B |Payment--Sale |

|A is next to B |POST--POST |

|A is owned by B |POST--Store |

More about Associations

A minimum model would limit associations to “need-to-know” relationships

suggested by the requirements and use cases.

Beyond minimum model, only add associations that enrich understanding.

Avoid showing redundant or derivable associations.

Derived association is shown with a / before its name

Student is taking Course, Lecturer teaches Course, Lecturer /teaches Student

Example of Case Study need-to-know associations

.

|Association |Needed: |

|POST Captures Sales |In order to know the current sales, |

| |generate a total, |

| |print a receipt |

|Sale Paid-by Payment |In order to know if the sale has been paid, relate the amount |

| |tendered to the sale total, and print a receipt |

|ProductCatalog Records |In order to retrieve an ItemSpecification, given a UPC |

|ItemSpecifications | |

Example of Case Study relationships not needed

.

|Association |Requirements do not indicate need-to-know, record or maintain |

|POST Started-by Manager |the manager who starts up a POST |

|Sale Initiated-by Customer |the current customer who initiates a sale |

|Store Stocks Item |inventory information |

|SalesLineItem Records-sale-of Item |inventory information |

Example Glossary

|Term |Category |Comments: |

|Buy Items |Use case |Description of the process of a customer buying items in a |

| | |store |

|Sale |Type |A sales transaction. |

|SalesLineItem |Type |A line item for a particular item bought within a Sale |

|SalesLineItem.quantity:Integer |Attribute |The quantity of one kind of item bought. |

3rd Assignment (5 points)

• Create a Conceptual model

-----------------------

[pic]

[pic]

[pic]

[pic]

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download