freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

第7講模式與對象設(shè)計(編輯修改稿)

2024-11-22 13:05 本頁面
 

【文章內(nèi)容簡介】 是一種表示用例實現(xiàn)的通用的語言 上海交通大學計算機科學與工程系 2020/11/23 75 : S y s t e me n t e r I t e m( i d , q u a n t i t y )e n d S a l e ( )m a k e P a y m e n t( a m o u n t )P r o c e s s S a l e1 . C u s t o m e ra r r i v e s . . .2 . C a s h i e rm a k e s n e ws a l e .3 . C a s h i e re n t e r s i t e mi d e n t i f i e r .4 . . . .U s e C a s e sS y s t e m S e q u e n c e D i a g r a msO p e r a t i o n : e n t e r I t e mP o s t c o n d i t i o n s : A S a l e s L i n e I t e m i n s t a n c es l i w a s c r e a t e d . . .O p e r a t i o n : m a k e N e w S a l eP o s t c o n d i t i o n s : . . .C o n t r a c t sm a k eN e w S a l e ( ): C a s h i e rS a l ed a t e. . .S a l e sL i n e I t e mq u a n t i t y1 . .*1. . .. . .d o m a i n o b j e c t ss y s t e me v e n t ss y s t e mo p e r a t i o n st h e d o m a i n o b j e c t s , a t t r i b u t e s , a n da s s o c i a t i o n s t h a t u n d e r g o s t a t e c h a n g e sD o m a i n M o d e lU s e C a s e M o d e ls o m e i d e a s a n d i n s p i r a t i o n f o r t h e p o s t c o n d i t i o n s d e r i v e f r o m t h e u s e c a s e sD e s i g n M o d e l: R e g i s t e re n t e r I t e m( i t e m I D , q u a n t i t y ): P r o d u c t C a t a l o gs p e c : = g e t S p e c i f i c a t i o n ( i t e m I D )a d d L i n e I t e m ( s p e c , q u a n t i t y ): S a l e. . .i n a d d i t i o n t o t h e u s ec a s e s , r e q u i r e m e n t s t h a tm u s t b e s a t i s f i e d b y t h ed e s i g n o f t h e s o f t w a r eu s e c a s er e a l i z a t i o nc o n c e p t u a lc l a s s e s i nt h ed o m a i ni n s p i r e t h en a m e s o fs o m es o f t w a r ec l a s s e s i nt h e d e s i g nm a k e N e w S a l e ( )c r e a t e ( )e n d S a l e ( ). . .. . .S a m p l e U P A rt i f a c t R e l a t i o n s h i p s f o r U s e C a s e R e a l i z a t i o n上海交通大學計算機科學與工程系 2020/11/23 76 ?協(xié)同圖( Collaboration Diagrams) 可以用于顯示用例實現(xiàn) :Register enterItem() :Register endSale() :Register makePayment() 1: ???() 1: ???() 1: ???() :Register makeNewSale() 1: ???() 上海交通大學計算機科學與工程系 2020/11/23 77 ?順序圖 : R e g i s t e re n t e r I t e m( i t e m I D , q u a n t i t y ): P r o d u c t C a t a l o gs p e c : = g e t P r o d u c t S p e c ( i t e m I D )a d d L i n e I t e m ( s p e c , q u a n t i t y ): S a l e. . .m a k e N e w S a l e ( )c r e a t e ( )e n d S a l e ( ). . .m a k e P a y m e n t ( . . . ). . .上海交通大學計算機科學與工程系 2020/11/23 78 ? or : R e g i s t e r: S a l em a k e N e w S a l e ( )c r e a t e ( ): R e g i s t e re n t e r I t e m( i t e m I D , q u a n t i t y ): P r o d u c t C a t a l o gs p e c : = g e t P r o d u c t S p e c ( it e m I D )a d d L i n e I t e m ( s p e c , q u a n t i t y ): S a l e. . .上海交通大學計算機科學與工程系 2020/11/23 79 ?契約和用例實現(xiàn) ? 有可能直接從用例的文字中設(shè)計用例實現(xiàn) ? 對某些系統(tǒng)操作而言,契約可以用于增加描述細節(jié) ? 契約 CO2: enterItem ?Operation: enterItem(ItemID: ItemID, quantity:integer) ?Cross References: Use Cases: Process Sale ?Preconditions: There is a sale underway ?Postconditions: ? A SalesLineItem instance sli was created (instance creation) ? 上海交通大學計算機科學與工程系 2020/11/23 80 1: makeLineItem(...) enterItem(id, qty) : create(...) :Register :Sale :SalesLineItem Satisfy the state change of SalesLineItem instance creation 上海交通大學計算機科學與工程系 2020/11/23 81 ?領(lǐng)域模型和用例實現(xiàn) ? 選擇合適的責任分配依賴于領(lǐng)域模型 ? 但是用例實現(xiàn)可能引起領(lǐng)域模型的修改 上海交通大學計算機科學與工程系 2020/11/23 82 ?概念 vs. 設(shè)計類 ? 領(lǐng)域模型可以用以啟發(fā)我們在設(shè)計模型中定義軟件類并據(jù)此命名 上海交通大學計算機科學與工程系 2020/11/23 83 Payment amount Sale date time Paysfor Payment amount: Money getBalance(): Money Sale date: Date startTime: Time getTotal(): Money . . . Paysfor UP Domain Model Stakeholder39。s view of the noteworthy concepts in the domain. UP Design Model The object developer has taken inspiration from the realworld domain in creating software classes. Therefore, the representational gap between how stakeholders conceive the domain, and its representation in software, has been lowered. 1 1 1 1 inspires objects and names in conceptual classes design classes 上海交通大學計算機科學與工程系 迭代的 UseCase實現(xiàn) 上海交通大學計算機科學與工程系 2020/11/23 85 對象設(shè)計 : makeNewSale ? makeNewSale 系統(tǒng)操作發(fā)生于當收銀員在顧客到達后有東西要買,開始一筆新的買賣時 Contract CO1: makeNewSale Operation: makeNewSale() Cross References: Use Cases: Process Sale Preconditions: none Postconditions: A Sale instance s was created(instance creation) s was associated with the Register (association formed) Attributes of s were initialized 上海交通大學計算機科學與工程系 2020/11/23 86 選擇一個控制類 ?依據(jù)控制者模式,下面是一些選擇項 : 代表整個“系統(tǒng)”,設(shè)備或子系統(tǒng) Register, POSSystem 代表一個用例場景中系統(tǒng)事件的接收者或者處理者 ProcessSaleHandler ProcessSaleSession Fa231。ade Controller Use Case Controller 在 設(shè)計模型 中,該 Register 是一個軟件對象。它不是一個真實的物理的收銀臺,而是一種軟件抽象,選擇這個名字可以減少領(lǐng)域和軟件概念之間的 表示鴻溝 . 上海交通大學計算機科學與工程系 2020/11/23 87 ?在這個案例中,由于只有少數(shù)系統(tǒng)操作 , Register 足夠了 : R e g i s t e rm a k e N e w S a l e ( )b y C o n t r o l l e r上海交通大學計算機科學與工程系 2020/11/23 88 創(chuàng)建新 Sale ?軟件對象 Sale 必須被創(chuàng)建 : Creator 模式 ?誰來創(chuàng)建它呢 ? ? Register : 創(chuàng)建它,然后與之關(guān)聯(lián) ?當 Sale 創(chuàng)建后,它必須創(chuàng)建一個空的集合,以記錄所有的將來要被添加的 SalesLineItem 實例 上海交通大學計算機科學與工程系 2020/11/23 89 :Register makeNewSale() :Sale create() Register creates a Sale by Creator create() :Sales LineItem by Creator, Sale creates an empty multiobject (such as a List) which will eventually hold SalesLineItem instances CAUTION: This is not a SalesLineItem instance. This is a collection object (such as a List) that can hold SalesLineitem objects. by Creator an
點擊復制文檔內(nèi)容
教學課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1