* Price: Price * Enumeration getZones() during requirements - - PDF document

price price enumeration getzones during requirements
SMART_READER_LITE
LIVE PREVIEW

* Price: Price * Enumeration getZones() during requirements - - PDF document

Class Diagrams - 1 Class Diagrams - 2 Class diagrams represent the structure Trip TarifSchedule of the system. zone:Zone Used * Price: Price * Enumeration getZones() during requirements analysis to model Price getPrice(Zone)


slide-1
SLIDE 1

1

Class Diagrams - 1

  • Class diagrams represent the structure
  • f the system.
  • Used

–during requirements analysis to model problem domain concepts –during system design to model subsystems and interfaces –during object design to model classes

Class Diagrams - 2

Enumeration getZones() Price getPrice(Zone) TarifSchedule

* *

Trip zone:Zone Price: Price

Class

  • A class represent a concept
  • A class encapsulates state (attributes)

and behavior (operations).

  • Each attribute has a type.
  • Each operation has a signature.
  • The class name is the only mandatory

information.

TarifSchedule - 1

zone2price getZones() getPrice() TarifSchedule Name Attributes Operations TarifSchedule Name only

TarifSchedule - 2

Table zone2price Enumeration getZones() Price getPrice(Zone) TarifSchedule Signature Type

Instances

  • An instance represents a phenomenon.
  • The name of an instance is underlined and

can contain the class of the instance.

  • The attributes are represented with their

values.

tarif_1974:TarifSchedule zone2price = { {‘1’, .20}, {‘2’, .40}, {‘3’, .60}}

slide-2
SLIDE 2

2

Associations

Enumeration getZones() Price getPrice(Zone) TarifSchedule

* *

Trip zone:Zone Price: Price

  • Associations denote relationships between

classes.

  • The multiplicity of an association end

denotes how many objects the source object can legitimately reference.

One-to-one association

Country name:String City name:String Has-capital

One-to-many association

Polygon draw() Point x: Integer y: Integer

*

From Problem Statement To Object Model

  • Problem Statement: A stock exchange lists

many companies. Each company is uniquely identified by a ticker symbol. A company may be listed on more than one stock exchange.

StockExchange Company tickerSymbol Lists * *

To Java Code

public class StockExchange { private ArrayList m_Company = new ArrayList(); }; public class Company { public int m_tickerSymbol; private ArrayList m_StockExchange = new ArrayList(); };

Converting many-to-many to many-to-one

StockExchange Company Lists 1 *

tickerSymbol

*

Qualifier

slide-3
SLIDE 3

3

Aggregation - 1

  • An aggregation is a special case of

association denoting a “consists of” hierarchy.

  • The aggregate is the parent class, the

components are the children class.

Exhaust system Muffler diameter Tailpipe diameter

1 0..2

Aggregation - 2

  • A solid diamond denotes composition, a

strong form of aggregation where components cannot exist without the aggregate.

T icke tMach ine ZoneBut ton 3

Inheritance

  • The children classes inherit the attributes

and operations of the parent class.

  • Inheritance simplifies the model by

eliminating redundancy.

But ton ZoneBut ton Cance lBut ton

Customer

Name CustomerId()

Account

Amount Deposit() Withdraw() Balance() Bank

Name

Has

* *

Savings Account

Withdraw() Checking Account Withdraw() Mortgage Account Withdraw()

Packages - 1

  • A package is a UML mechanism for
  • rganizing elements into groups

(usually not an application domain concept)

  • Packages are the basic grouping

construct with which you may

  • rganize UML models to increase

their readability.

Packages - 2

  • A complex system can be decomposed

into subsystems, where each subsystem is modeled as a package

Dispatcher Interface Notification Incident Management