kiến trúc phần mềm,trần minh triết,dhkhtnhcm filectt526 - kiến trúc phần mềm tài...

16
CTT526 - Kiến trúc phnmm Tài liệu kiến trúc phần mềm PGS.TS. Trn Minh Triết [email protected] Trường Đi hc Khoa Hc TNhiên Khoa Công NghThông Tin Bmôn Công NghPhn Mm Version 1.0 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Upload: others

Post on 04-Nov-2019

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

CTT526 - Kiến trúc phần mềm

Tài liệu kiến trúc phần mềm

PGS.TS. Trần Minh Triết

[email protected]

Trường Đại học Khoa Học Tự NhiênKhoa Công Nghệ Thông Tin

Bộ môn Công Nghệ Phần Mềm

Version 1.0 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 2: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Nội dung của bài giảng sử dụng:

Session 6:

Documenting a Software Architecture

trong bộ slide Software Architecture Essential

của GS. Ian Gorton

Software Engineering Institute

Carnegie Mellon University

2

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 3: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Architecture Documentation

Architecture documentation is a thorny issue

Commonly there is no documentation covering the

architecture.

If it is, it’s out-of-date, inappropriate and basically not

very useful.

Also projects that have masses of architecture related

information

Sometimes invaluable, but often it’s out-of-date,

inappropriate and not very useful!

3

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 4: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Documenting an Architecture is

good!

Others can understand/evaluate the design.

We can understand the design after a period of time.

Others in the project team and development

organization can learn from the architecture.

We can do analysis on the design, perhaps to assess

its likely performance, or to generate standard metrics.

4

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 5: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

But it’s difficult …

No universally accepted architecture documentation standard.

An architecture can be complex, and documenting it in a comprehensible manner is time consuming and non-trivial.

An architecture has many possible views. Documenting all the potentially useful ones is time consuming and expensive.

An architecture design often evolves Keeping the architecture documents current is often forgotten, especially with time and schedule pressures in a project.

5

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 6: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Think carefully about what to

document Project complexity A small project may only need a ‘marketecture’

Project longevity One-off stop gap software?

Strategic, long-term, will evolve?

Needs of stakeholders Small team, a whiteboard might be ok

Large, dislocated team needs more

Integrators? Testers? Programmers?

Need to spend documentation dollars/euros wisely on high value products

6

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 7: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

UML 2.0

UML is a powerful way to document an architecture

Provides a relatively formal, unambiguous description

New features in UML 2.0 appropriate for architectures

Good tools available, some free

Can be used to depict various structural/behavioral architecture views

7

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 8: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Component Diagram

8

id Component View

OrderProcessing

MailQueue

SendEmail

MailServer

OrderSystem

CustomerSystem OrderQueue

«table»

NewOrders

1validate

1

readQ

1writeQ

1

read

1send

1

1readQ

1

1

writeQ

1

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 9: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Class Diagram

9

cd OrderProcessing

OrderReader

Validate Store

QueueWriter

1

1

1 1

1

1

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 10: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Sequence Diagram

10

sd Interactions

OrderReader

MailQueue

Validate

OrderQueue

Store QueueWriter

NewOrders CustomerSystem

readOrderData

success:=

validateOrder

success:=

newOrder

success:=

storeOrder

success:=

writeQueue

success:=

acknowledgeOrderSuccess

success:=

writeQueue

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 11: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Deployment Diagram

11

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 12: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Component Interfaces

12

id Component View

OrderProcessing

MailQueue

SendEmail

MailServer

OrderSystemCustomerSystem

OrderQueue

«table»

NewOrders

JDBC

SMTP

QueueRead

QueueRead

QueueWrite

CustomerServices

QueueWrite

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 13: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Component Decomposition

13

id Component View

OrderProcessing

validateOrder

getOrders writeConfirmation

writeOrder

MailQueue

SendEmail

MailServer

OrderSystemCustomerSystem

validate

ProvidedInterface1

OrderQueue

«table»

NewOrders

JDBC

QueueWrite

QueueWrite

CustomerServices SMTP

QueueRead

QueueRead

cd Component View

OrderProcessing

getOrders

validateOrder

writeConfirmation

writeOrder

or: OrderReader

val: Validate

qw:

QueueWriter

st: Store

«delegate»

«delegate»

«delegate»

«delegate»

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 14: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Document Template

Documentation is easier if there’s a template to use

Reduces start-up time for projects by providing

ready-made document structures

familiarity gained with the document structure aids in

the efficient capture of project design details.

help with the training of new staff

14

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 15: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Template Headings

15

Architecture Documentation Template

Project Name: XXX

1 Project Context

2 Architecture Requirements

2.1 Overview of Key Objectives

2.2 Architecture Use Cases

2.3 Stakeholder Architectural Requirements

2.4 Constraints

2.5 Non-functional Requirements

2.6 Risks

3 Solution

3.1 Relevant Architectural Patterns

3.2 Architecture Overview

3.3 Structural Views

3.4 Behavioral Views

3.5 Implementation Issues

4 Architecture Analysis

4.1 Scenario analysis

4.2 Risks

CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 16: kiến trúc phần mềm,trần minh triết,dhkhtnhcm fileCTT526 - Kiến trúc phần mềm Tài liệu kiến trúc phần mềm PGS.TS. Trần Minh Triết tmtriet@fit.hcmus.edu.vn

Summary

Some documentation is nearly always a good idea

Trick is to produce ‘just enough’ and no more

requires upfront planning and thinking

Commitment to keeps docs current

UML 2.0 makes architecture documentation easier

Some good UML 2.0 tools, try ‘em out.

16

CuuDuongThanCong.com https://fb.com/tailieudientucntt