staruml ns guide - design
DESCRIPTION
StarUML NS Guide - DesignTRANSCRIPT
Sections
Design
Chap-ter 7
1. Design Overview
2. Detailed Design
3. Data Modeling
4. User-Interface Design
5. Realizing Use Cases (Design)
Lecture Objectives
Design Chap-ter 7
설계 단계에 대한 기본 개념 이해 설계 , 구현 , 배치 모델에 대한 이해 및 작성 설계 패턴에 대한 이해 및 적용 데이터베이스 설계 사용자 인터페이스 설계
Design Chap-ter7
Design Overview
Section 1.
Design Overview
Design Chap-ter7
Design Overview (cont.)
Design Chap-ter7
Design Chap-ter7
Detailed Design
Section 2.
Contents
Design Chap-ter7
Activity Overview Concepts and Notations Design Patterns Steps Example Exercise
Activity Overview
Design Chap-ter7
Concepts and Notations
Design Chap-ter7
Advanced Structual Modeling• Abstract Class• Template Class• Enumeration and Literal• Signal and Exception• Aggregation and Composition• Qualifier• AssociationClass• Subsystem
State Modeling• Statechart Diagram• StateMachine• State• Transition• CompositeState• Pseudostates
Design Patterns• Façade• Observer• Factory Method
Artifacts• Design Model• Implementation Model• Deployment Model
Abstract Class
Design Chap-ter7
완전한 구현을 제공하지 않는 클래스 인스턴스 (Instance) 를 생성할 수 없음 . 클래스 이름을 이탤릭 (Italic) 으로 표현
Cash Payment Credit Payment Check Payment
Payment
amount : Money
Abstract Class
Template Class
Design Chap-ter7
일부분이 파라미터화 된 클래스 유사한 클래스들의 집단을 정의
Stack
+Items: T[0..*]
+Push(Item: T)+Pop(): T
T : Class
Template ParametersTemplate Class
Enumeration and Literal
Design Chap-ter7
열거형 (Enumeration)• 미리 정의된 항목들을 가지는 일종의 데이터타입
리터럴 (Literal)• 열거형이 가지는 각각의 항목
<<enumeration>>Sex
+Male +Female
Enumeration
Literals
Signal and Exception
Design Chap-ter7
신호 (Signal)• 송신자와 수신자 사이에 동기적 , 혹은 비동기적으로 전송되는 객체
예외 (Exception)• 시스템의 예기치 않은 상황을 표현하는 신호 (Signal)
<<exception>>StackOverflow
<<signal>>MouseClick
Aggregation
Design Chap-ter7
객체들 사이의 포함관계 (whole-part) 포함 관계가 다소 약하고 유연한 관계
AssociationAggregateKind =
Aggregation
Person Company
Composition
Design Chap-ter7
객체들 사이의 포함관계 (whole-part) 포함 관계가 강하여 생명주기를 전체에 의존
AssociationAggregateKind =
Composition
PersonHeart
Qualifier
Design Chap-ter7
한쪽 객체로 다른 한쪽의 객체집합을 한정시킴 주어진 값으로 객체 혹은 객체 집합을 찾음
Bank Person
0..1*
+AccountNum
AssociationClass
Design Chap-ter7
두 클래스 사이의 연관을 표현하는 클래스• Association + Class = AssociationClass
Company Person+employee+employer
1..**
Job
+salary
Manages
+boss
+worker0..1
*
Subsystem
Design Chap-ter7
시스템의 전체 혹은 부분 시스템을 추상화 클래스와 패키지의 특성을 동시에 지님 여러 개의 인터페이스를 구현
CustomerServiceSubsystem
SubsystemInterface Realization
Statechart Diagram
Design Chap-ter7
특정 개체에 대한 상태 전이를 체계적으로 표현 일반적으로 하나의 상태머신 (state machine) 을 표현 시스템의 동적 측면의 모델을 표현
Idle
Transmitting
Receiving
entry/pickUpexit/disconnect
Connected
Processing
Cleaning up
Connected
Processing
Cleaning up
sendFax
ringing
headerOK
checkSumOK
hangUp
error / printReport
StateMachine
Design Chap-ter7
상태 전이를 체계적으로 명세화한 요소 구성 요소
• 상태 요소 (State, CompositeState, Final State, …)• 전이 (Transition)
State
Design Chap-ter7
객체 생명기간 동안 가질 수 있는 특정 상황 여러 가지 동작 (Action) 들을 포함
Type password
entry/set echo invisible
exit/set echo normal
do/wait
Name
Entry Action
Exit Action
Do Action
Transition
Design Chap-ter7
어떤 상태에서 다른 상태로의 전이를 표현
Idle Draggedmouse down [ location in Windows ] / Object = pick-Object
Guard Condition Effect (Action)Trigger (Event)
TransitionState State
Composite State
Design Chap-ter7
상태들을 포함하는 상태Dialog
Start
entry/start dial tone
exit/stop dial tone
Partial Dial
entry/number.append(n)
digit(n)
digit(n)
[number.isValid]
Pseudostates
Design Chap-ter7
상태 머신 내의 과도기적 지점을 나타내는 여러 가지 형태를 묘사하는 요소
H H*
Initial State Junction Choice Shallow History Deep History Fork/Join
Design Patterns
Design Chap-ter7
시스템 디자인 시에 자주 발생하는 문제들에 대한 “재사용 가능한 해결책”
소프트웨어 엔지니어의 경험
Looking for footprint in the snow and putting the pavement there"- Brian Foote (Architect) -
Design Patterns (cont.)
Design Chap-ter7
Benefits of Design Pattern• 시스템의 설계를 위한 재사용 가능한 경험을 제공• 디자이너들 간의 대화하고 문서화하기 위한 어휘 (vocabulary) 를 제공• 설계를 이해하는 시간을 단축
Design Patterns (cont.)
Design Chap-ter7
Design Patterns (from Eric Gamma et al.)
Design Patterns (cont.)
Design Chap-ter7
Façade Observer Factory Method
Design Patterns: Façade
Design Chap-ter7
Purpose• 서브시스템의 복잡한 인터페이스를 하나로 통합하여 접근하기 쉽도록 함 .
Design Patterns: Façade (cont.)
Design Chap-ter7
Applications• 서브시스템에 대한 단순한 인터페이스를 제공• 클라이언트와 구현 클래스간의 종속적의 단순화
Consequences• 서브시스템의 구성 요소를 변경으로부터 보호• 서브시스템과 클라이언트의 결합도를 낮춤• Façade 는 필수가 아닌 선택으로 활용할 수 있음
Design Patterns: Observer
Design Chap-ter7
Purpose• 일대다 (1:*) 의 관계를 갖는 객체 관계에서 한 객체의 상태 변화를 다른
모든 객체에 알리도록 함 .
A = 50B = 30C = 20
0
10
20
30
40
50
60
A B C
50%30%
20%
Design Patterns: Observer (cont.)
Design Chap-ter7
Subject
+Attach(o: Observer)+Detach(o: Observer)+Notify()
Observer
+Update()
ConcreteSubject
+subjectState
+GetState()+SetState()
ConcreteObserver
+Update()
+observers
*
+subject
Subject::Notify() for all o in observers { o.Update(); }
ConcreteSubject::GetState() return subjectState; ConcreteObserver::Update()
observerState = subject.GetState();
: ConcreteSubject : ConcreteObserver
SetState()
Notify()
*[for all observers] : Update()
GetState()
구조 (Structure)
동작 (Interaction)
Design Patterns: Observer (cont.)
Design Chap-ter7
Applications• 특정 객체 상태 변화를 통보 받는 객체가 여럿인 경우• 객체 변화를 통보할 때 누가 관심이 있는지에 가정을 미리 할 수 없는
경우
Consequences• Subject 와 Observer 간에는 추상적 결합만 존재• Broadcast 방식의 교류를 가능하게 함
Design Patterns: Factory Method
Design Chap-ter7
Purpose• 객체 생성의 인터페이스만을 제공하고 어떤 객체를 생성할 지는
서브클래스로 미룸Document
+Open()+Close()+Save()+Revert()
MyDocument
Application
+CreateDocument()+NewDocument()+OpenDocument()
MyApplication
+CreateDocument()
+docs
*
Application::NewDocument() Document doc = CreateDocument(); docs.add(doc); doc.Open();
MyApplication::CreateDocument() return new MyDocument();
Design Patterns: Factory Method (cont.)
Design Chap-ter7
Applications• 생성할 객체 타입을 예측할 수 없을 때• 객체 생성의 책임을 서브클래스로 미룰 때• 객체를 생성하는 서브클래스에 대한 정보를 은닉할 때
Consequences• 서브클래스에 대한 훅 (Hook) 메소드를 제공• 병렬적 클래스 계층도를 연결하는 역할을 담당
Design Model
Design Chap-ter7
클래스 , 패키지 등의 요소들로 시스템을 구현하는 요소들을 상세하게 정의한 모델
Implementation Model
Design Chap-ter7
시스템에 포함되는 컴포넌트들의 구성• 소프트웨어 컴포넌트• 실행파일• 라이브러리 (DLL 등 )
Deployment Model
Design Chap-ter7
시스템에 포함되는 노드들의 구성• 컴퓨터 , 서버 , 메인프레임 등• 각종 내부 및 외부 하드웨어 장비
Design, Implementation, Deployment Model
Design Chap-ter7
<<reside>>
<<reside>>
<<reside>>
<<reside>>
<<deploy>>
<<deploy>>
DesignModel
ImplementationModel
DeploymentModel
Steps (Detailed Design)
Design Chap-ter7
1. 패키지 구조를 정의한다 .2. 분석클래스로부터 상세한 설계클래스 정의한다 .3. 구현 모델 정의한다 .4. 배치 모델 정의한다 .5. 설계 , 구현 , 배치 모델의 동기화한다 .6. 중요한 요소의 상태 머신을 모델링한다 .
Example
Design Chap-ter7
Example (cont.)
Design Chap-ter7
Reservation.dll MeetingRoom.dll
PMS NotifSystem
INofityIUserAuth
IReservation
IMeetingRoom
Example (cont.)
Design Chap-ter7
WebBrow ser Application Server Database ServerLAN LAN
Notify Server
LAN
LAN
Exercise
Design Chap-ter7
Develop a Design Model that provides detailed de-sign of your system.
Select a significant class and draw a statechart di-agram of the class.
Select a significant operation and draw sequence diagram of the operation.
Design Chap-ter7
Data Modeling
Section 3.
Contents
Design Chap-ter7
Activity Overview Concepts and Notations Steps Example Exercise
Activity Overview
Design Chap-ter7
Data Model
AnalysisModel
DomainModel
DatabaseDesigner
DataModeling
SoftwareRequirementsSpecification
Data Model
Design Chap-ter7
Requirements
Analysis
Design
Entity Entity
Use CaseUse Case SpecificationsGlossary Domain Model
Design Model Data Model
Steps (Data Modeling)
Design Chap-ter7
1. 엔티티 클래스로부터 데이터 개체 식별2. 구체적인 데이터 개체 및 관계 정의
Example
Design Chap-ter7
Reservation<<table>>
+index: INT+Date: DATE+StartTime: TIME+EndTime: TIME+requester: EmployeeID+Room: MeetingRoom+MeetingSubject: VARCHAR[50]+Description: MEMO
<<PK>>+index()<<FK>>+Room()
MeetingRoom<<table>>
+index: INT+Location: VARCHAR[50]+Capability: INT+Machine: VARCHAR[50]+view : Blob
<<PK>>+index()
*1
Exercise
Design Chap-ter7
Develop a Data Model of your system.
Design Chap-ter7
User-Interface Design
Section 4.
Contents
Design Chap-ter7
Activity Overview Concepts and Notations Steps Example Exercise
Activity Overview
Design Chap-ter7
User-InterfaceDesigner
User-InterfaceDesign
User-InterfacePrototype
AnalysisModel
SoftwareRequirementsSpecification
User-Interface
Design Chap-ter7
Requirements
Analysis
Design
Use Case
Boundary Boundary
User interface Subsystem
User-Interface (cont.)
Design Chap-ter7
WriteArticleForm<<WebForm>>
Design Class User-Interface Prototype
Steps (User-Interface Design)
Design
1. 경계 클래스로부터 사용자 인터페이스들을 식별한다 .2. 각각의 사용자 인터페이스에 대하여
1. 사용자 인터페이스에 해당하는 설계 클래스를 추가2. 사용자 인터페이스 프로토타입을 개발한다 .
Example
Design
WaitingStateReservationForm<<ASPX>>
+txtReservationID: TextBox+txtReservationSubject: TextBox+txtRequester: TextBox+btnAggrement: Button+btnDisapproval: Button
+btnAggrement_Click()+btnDisapproval_Click()
<<post>>
RetrieveReservationForm<<ASPX>>
+ConfirmCancel()
<<post>>
ReserveMeetingRoomForm<<ASPX>>
+txtSubject: TextBox+txtDate: TextBox+txtStartTime: TextBox+txtEndTime: TextBox+txtDescription: TextBox+btnSubmit: Button
+btnSubmit_Click()
<<post>>
Design Chap-ter7
Realizing Use Cases (Design)
Section 5.
Exercise
Design Chap-ter7
Make user-interface prototypes of your system.
Contents
Design Chap-ter7
Activity Overview Concepts and Notations Steps Example Exercise
Activity Overview
Design Chap-ter7
Use CaseRealizations
Data ModelUser-Interface
PrototypeSoftware
RequirementsSpecification
DesignModel
Use CaseRealizations(analysis-level)
Data Model(updated)
User-InterfacePrototype
(updated)
DesignModel(updated)
Designer RealizingUse Cases
Use Case Realization
Design Chap-ter7
유스케이스와 실체화 관계를 맺는 하나의 협동
Use Case
Use Case Realization
Use Case
Realization
Collaboration
Use Case Realization (cont.)
Design Chap-ter7
Steps (Realizing Use Cases)
Design Chap-ter7
1. 각각의 유스케이스에 대하여1. 시퀀스 혹은 협동 다이어그램 생성2. 관련된 설계 클래스 , 사용자 인터페이스 , 데이터 개체들을
다이어그램에 배치3. 상호작용을 상세하게 표현
Example (cont.)
Design Chap-ter7
회의실 예약 요청을 처리한다<<use case realization>>
회의실을 예약한다<<use case realization>>
회의실 예약을 취소한다<<use case realization>>
사용자 인증을 한다<<use case realization>>
회의실 정보를 관리한다<<use case realization>>
회의실 예약을 조회한다<<use case realization>>
회 의 실 예 약 요 청 을 처 리 한 다
회 의 실 을 예 약 한 다
회 의 실 예 약 을 취 소 한 다
사 용 자 인 증 을 한 다
회 의 실 예 약 을 조 회 한 다
회 의 실 정 보 를 관 리 한 다
Example
Design Chap-ter7
회의실을 예약한다 (Use Case Realization)
: 사원
: ReservationManagement : ReservationInfomation : ReserveMeetingRoomForm : RetrieveMeetingRoomForm
btnDate_Click()retrieveReservations(aDate)
search(adate)()화면출력
btnReserve_Click(aMR, aDate, aTime)
requestReservationForm()
()회의실 예약 폼 출력btnSubmit_Click()
add(aReservation)
validateCheck()
[is Complete] : Create(aReservation)
Exercise
Design Chap-ter7
Draw sequence or collaboration diagrams repre-senting use case realization, in terms of design classes, for each use case in your system.
Lecture Summary
Design Chap-ter7
설계 모델 , 구현 모델 , 배치 모델은 시스템의 정적 구조를 상세하게 묘사한다 .
유스케이스 실체화는 시스템의 행위를 표현해줄 뿐만 아니라 시스템의 기능적 요구사항을 충족할 수 있는지를 검토하는 역할도 수행한다 .