第10讲细化迭代3内容摘要:

上海交通大学计算机科学与工程系 2020/11/4 52 1)目标 创建“泛化 例化”层次结构 确定何时显示子类 运用 “ 100%” 和 “ ISa” 测试来验证子类 泛化和例化是领域建模中的基本概念 上海交通大学计算机科学与工程系 2020/11/4 53 2)领域模型中的新概念 有用的技术 :  概念类列表  名词识别  读相关的材料 上海交通大学计算机科学与工程系 2020/11/4 54 3)泛化  泛化( Generalization) 是在概念中识别共同点并定义超类(通用的概念)和子类(特殊的概念)关系的活动 Ca s hP a y me n tCr e d i tP a y me n tCh e c kP a y me n tP a y me n ts u p e r c l a s s mo r e g e n e r a lc o n c e p ts u b c la s s mo r es p e c i a l i z e d c o n c e p tt h e s e a r e c o n c e p t u a lc l a s s e s , n o t s o f t w a r ec l a s s e s上海交通大学计算机科学与工程系 2020/11/4 55  UML 标记 : 采用一个大的空心箭头从特殊指向一般的元素 C a s hP a y me n tC r e d i tP a y me n tC h e c kP a y me n tP a y me n tC a s hP a y me n tC r e d i tP a y me n tC h e c kP a y me n tP a y me n t上海交通大学计算机科学与工程系 2020/11/4 56 4)定义概念超类和子类 概念超类( A conceptual superclass) 是比子类定义更一般或包含它的类 Ca s hP a y m e n tCr e d i tP a y m e n tCh e c kP a y m e n tP a y m e n ta m o u n t : Mo n e yAll the members of a conceptual subclass set are members of their superclass set. 上海交通大学计算机科学与工程系 2020/11/4 57 5)概念子类的依从性 当类的层次结构被创建后,对超类的申明也作用于子类上 Ca s hPa y m e n tCr e d i tPa y m e n tCh e c kPa y m e n tPa y m e n ta m o u n t : M o n e ySa l ePa y s f o r11上海交通大学计算机科学与工程系 2020/11/4 58 100% 规则 概念超类定义必须 100% 应用于子类上 . 子类必须百分百遵从超类的 : •属性 •关联 上海交通大学计算机科学与工程系 2020/11/4 59 Isa Rule 子类所有的成员必须是超类的成员 . 用自然语言表达,可以用下列声明来测试一下 : Subclass is a Superclass 上海交通大学计算机科学与工程系 2020/11/4 60 6)正确的概念子类 可能的子类必须满足 :  100% 规则 (定义遵循性 )  Isa 规则 (集合成员遵循性 ) 上海交通大学计算机科学与工程系 2020/11/4 61 7)何时定义概念子类 我们是否需要把 Customer 分成 MaleCustomer 和FemaleCustomer? M a l eC u s t o m e rF e m a l eC u s t o m e rC u s t o m e r C o r r e c t s u b c l a s s e s .B u t u s e f u l ?上海交通大学计算机科学与工程系 2020/11/4 62 下列情况需要定义超类的概念子类 :  1. 子类有其它有意义的属性  2. 子类有其它有意义的关联  3. 子类与超类相比,在行为上(作用,反映,操作等)与超类或其它子类有差别  4. 子类概念代表了一个活的东西 (for example, animal, robot) ,其行为与超类或者其它子类不同,而这行为是我们所关注的 Library: Book, is a LoanableResource CreditPayment is a Payment CreditPayment is a Payment Market Research: MaleHuman, FemalHuman 上海交通大学计算机科学与工程系 2020/11/4 63 何时定义概念超类 :  潜在的概念子类表示的是相似概念的不同变体  子类满足 100% 和 Isa 规则  所有子类都具有相同的属性,可以将其解析出来并在超类中表达  所有子类都具有相同的关联,可以将其解析出来并于超类关联 上海交通大学计算机科学与工程系 2020/11/4 64 8)确定 Payment 子类 Cash Payment Credit Payment Check Payment Payment amount : Money Check Identifiescreditwith Paidwith * each payment subclass is handled differently additional associations superclass justified by mon attributes and associations Sale Paysfor CreditCard 1 1 1 1 上海交通大学计算机科学与工程系 2020/11/4 65 9)确定授权服务的层次 C r e d i tA u t h o r i z a t i o nS e r v i c eC h e c kA u t h o r i z a t i o nS e r v i c eC h e c kP a y m e n tA u t h o r i z a t i o n S e r v i c ea d d r e s sn a m ep h o n e N u m b e ra d d i t i o n a l a s s o c i a t i o n ss u p e r c l a s s j u s t i f i e d b yc o m m o n a t t r i b u t e s a n da s s o c i a t i o n sS t o r eA u t h o r i z e s p a y m e n t s o f*A u t h o r i z e sC r e d i tP a y m e n tA u t h o r i z e s***1 1上海交通大学计算机科学与工程系 2020/11/4 66 CreditPayment Approval Reply CheckPayment Approval Reply CreditPayment Approval Request CheckPayment Approval Request CreditPayment Denial Reply CheckPayment Denial Reply CheckPayment Authorization Reply CreditPayment Authorization Reply Payment Authorization Reply Payment Authorization Request Payment Authorization Transaction date time Concepts too fine grained? Useful to show this degree of partitioning? Each transaction is handled differently, so it is useful to partition them into discrete classes. 上海交通大学计算机科学与工程系 2020/11/4 67 Cr e d i t P a y me n tA p p r o v a lRe q u e s tCh e c k P a y me n tA p p r o v a lRe q u e s tP a y me n tA u t h o r i z a t i o nRe p l yP a y me n tA u t h o r i z a t i o nRe q u e s tP a y me n t。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。