02291: System Integration Components (Part Ia) Hubert Baumeister - - PowerPoint PPT Presentation

02291 system integration
SMART_READER_LITE
LIVE PREVIEW

02291: System Integration Components (Part Ia) Hubert Baumeister - - PowerPoint PPT Presentation

02291: System Integration Components (Part Ia) Hubert Baumeister huba@dtu.dk DTU Compute Technical University of Denmark Spring 2020 Software architecture Software architecture building blocks: components glue: connectors ports:


slide-1
SLIDE 1

02291: System Integration

Components (Part Ia) Hubert Baumeister

huba@dtu.dk

DTU Compute Technical University of Denmark

Spring 2020

slide-2
SLIDE 2

Software architecture

Software architecture ◮ building blocks: components ◮ glue: connectors ◮ ports: interfaces to the

  • utside
slide-3
SLIDE 3

Software architecture

Software architecture ◮ building blocks: components ◮ glue: connectors ◮ ports: interfaces to the

  • utside

Decompose the system into smaller components and their interconnection ◮ Components based on business responsibilities

slide-4
SLIDE 4

Components

Components: replaceable piece of software → Resuable → Pluggable

Company Clearing− Bank ATM BC BankATM AB CB BA

slide-5
SLIDE 5

Components

Components: replaceable piece of software → Resuable → Pluggable

Company Clearing− Bank ATM BC BankATM AB CB BA

Well-defined interfaces: provided and required → ports → connectors

slide-6
SLIDE 6

Components

Components: replaceable piece of software → Resuable → Pluggable

Company Clearing− Bank ATM BC BankATM AB CB BA

Well-defined interfaces: provided and required → ports → connectors ◮ Similar to classes: better encapsulation ◮ Component = set of collaborating classes ◮ Microservices are components

slide-7
SLIDE 7

Example Bank–ATM: UML 2.0 Component Diagram

pinNotOK pinOk verifyPIN verifyPIN withdraw pinOk pinNotOK withdrawOK withdrawNotOk

Company Clearing− Bank ATM BC BankATM AB CB BA

slide-8
SLIDE 8

Example Bank–ATM: Configuration (composite structure diagram)

Company b:Bank c:Clearing− :CB :BC :AB :AB :BankATM :BA :BA atm0:ATM atm1:ATM

slide-9
SLIDE 9

Strong encapsulation of components

◮ Strong encapsulation

◮ What is provided to others ◮ What is needed of others

◮ Ports define a portal to a component

◮ Have interfaces: provided / required ◮ Connect to other components

slide-10
SLIDE 10

Showing interfaces

Port AB Bank Clearing Company ATM Port BC Port BA Provided Interface by port AB Required Interface by port BA Provided Interface by port BA Required Interface by port AB

slide-11
SLIDE 11

Port BA

Bank ATM <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk <<interface>> BankToAtm verifyPIN(iban:IBAN, pin:int) withdraw(iban, amount:Money) «interface» I1 m 1 m 2 m 3 «interface» I2 m 1 m 3 C2 C1 «refine»

slide-12
SLIDE 12

Component Meta-Model

Conceptual meta-model (not actual UML 2.0 meta-model)

slide-13
SLIDE 13

Implementing components by components

UML User Manual, Grady Booch

slide-14
SLIDE 14

Implementing components by components

UML User Manual, Grady Booch

◮ External ports are mapped to some port of a subcomponent.

slide-15
SLIDE 15

Bank component with Implementation

Bank component seen from the outside Bank component seen from the inside

Bank Bank Customer Account ClearingCompanyToBank BankToAtm

*

«delegate» «delegate» * BankToATMPort «delegate» BankToClearingCompany AtmToBank «delegate»

slide-16
SLIDE 16

Detailed Class Diagram for the Bank Component

Port BC Port BA <<interface>> BankToClearingCompany pinOK pinNotOk <<interface>> ClearingCompanyToBank verifyPIN(a,p) <<interface>> BankToAtm verifyPIN(a,p) withdraw(a,m) BankToATMPort verifyPIN(a,p) withdraw(a,m) pinOK pinNotOk Account number : IBAN balance : int withdraw(amount:int): bool ... Customer name address ... <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk Bank name: String ... pinOK pinNotOk accountFor(a): Account ... 1 atm * 1 b * c * 1..* 1..* 1 cc

◮ Rules for classes implementing components

slide-17
SLIDE 17

Detailed Class Diagram for the Bank Component

Port BC Port BA <<interface>> BankToClearingCompany pinOK pinNotOk <<interface>> ClearingCompanyToBank verifyPIN(a,p) <<interface>> BankToAtm verifyPIN(a,p) withdraw(a,m) BankToATMPort verifyPIN(a,p) withdraw(a,m) pinOK pinNotOk Account number : IBAN balance : int withdraw(amount:int): bool ... Customer name address ... <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk Bank name: String ... pinOK pinNotOk accountFor(a): Account ... 1 atm * 1 b * c * 1..* 1..* 1 cc

◮ Rules for classes implementing components

◮ Provided interfaces must be implemented by some class

slide-18
SLIDE 18

Detailed Class Diagram for the Bank Component

Port BC Port BA <<interface>> BankToClearingCompany pinOK pinNotOk <<interface>> ClearingCompanyToBank verifyPIN(a,p) <<interface>> BankToAtm verifyPIN(a,p) withdraw(a,m) BankToATMPort verifyPIN(a,p) withdraw(a,m) pinOK pinNotOk Account number : IBAN balance : int withdraw(amount:int): bool ... Customer name address ... <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk Bank name: String ... pinOK pinNotOk accountFor(a): Account ... 1 atm * 1 b * c * 1..* 1..* 1 cc

◮ Rules for classes implementing components

◮ Provided interfaces must be implemented by some class ◮ Required interfaces must be used by one or serveral classes

slide-19
SLIDE 19

Detailed Class Diagram for the Bank Component

Port BC Port BA <<interface>> BankToClearingCompany pinOK pinNotOk <<interface>> ClearingCompanyToBank verifyPIN(a,p) <<interface>> BankToAtm verifyPIN(a,p) withdraw(a,m) BankToATMPort verifyPIN(a,p) withdraw(a,m) pinOK pinNotOk Account number : IBAN balance : int withdraw(amount:int): bool ... Customer name address ... <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk Bank name: String ... pinOK pinNotOk accountFor(a): Account ... 1 atm * 1 b * c * 1..* 1..* 1 cc

◮ Rules for classes implementing components

◮ Provided interfaces must be implemented by some class ◮ Required interfaces must be used by one or serveral classes ◮ No access to and from classes of other components (exception: common datatypes)

slide-20
SLIDE 20

Detailed Class Diagram for the Bank Component

Port BC Port BA <<interface>> BankToClearingCompany pinOK pinNotOk <<interface>> ClearingCompanyToBank verifyPIN(a,p) <<interface>> BankToAtm verifyPIN(a,p) withdraw(a,m) BankToATMPort verifyPIN(a,p) withdraw(a,m) pinOK pinNotOk Account number : IBAN balance : int withdraw(amount:int): bool ... Customer name address ... <<interface>> AtmToBank pinOK pinNotOK withdrawOk withdrawNotOk Bank name: String ... pinOK pinNotOk accountFor(a): Account ... 1 atm * 1 b * c * 1..* 1..* 1 cc

◮ Rules for classes implementing components

◮ Provided interfaces must be implemented by some class ◮ Required interfaces must be used by one or serveral classes ◮ No access to and from classes of other components (exception: common datatypes)

◮ Use packages to indicate classes belonging to a component

slide-21
SLIDE 21

Realizing components through programming

◮ No runtime representation (usually)

slide-22
SLIDE 22

Realizing components through programming

◮ No runtime representation (usually) ◮ No programming language support (usually)

slide-23
SLIDE 23

Realizing components through programming

◮ No runtime representation (usually) ◮ No programming language support (usually) ◮ Different types of component concepts

slide-24
SLIDE 24

Realizing components through programming

◮ No runtime representation (usually) ◮ No programming language support (usually) ◮ Different types of component concepts

◮ EJB, CORBA, COM/DCOM, .NET, JavaBeans, . . .

slide-25
SLIDE 25

Realizing components through programming

◮ No runtime representation (usually) ◮ No programming language support (usually) ◮ Different types of component concepts

◮ EJB, CORBA, COM/DCOM, .NET, JavaBeans, . . . ◮ Microservices

slide-26
SLIDE 26

Defining components

◮ Take your use cases

slide-27
SLIDE 27

Defining components

◮ Take your use cases ◮ Execute the use case scenarios using CRC cards

slide-28
SLIDE 28

Defining components

◮ Take your use cases ◮ Execute the use case scenarios using CRC cards ◮ Play with the level of abstraction

◮ Start with ”hardware” components ◮ Do the ”hardware” components have ”software” subcomponents? ◮ How are your components realized with classes?