软件需求分析课件:Chap 12-Model Refinement

上传人:cn****1 文档编号:568833114 上传时间:2024-07-27 格式:PPT 页数:70 大小:2.27MB
返回 下载 相关 举报
软件需求分析课件:Chap 12-Model Refinement_第1页
第1页 / 共70页
软件需求分析课件:Chap 12-Model Refinement_第2页
第2页 / 共70页
软件需求分析课件:Chap 12-Model Refinement_第3页
第3页 / 共70页
软件需求分析课件:Chap 12-Model Refinement_第4页
第4页 / 共70页
软件需求分析课件:Chap 12-Model Refinement_第5页
第5页 / 共70页
点击查看更多>>
资源描述

《软件需求分析课件:Chap 12-Model Refinement》由会员分享,可在线阅读,更多相关《软件需求分析课件:Chap 12-Model Refinement(70页珍藏版)》请在金锄头文库上搜索。

1、Elaboration Iteration 3-Intermediate TopicspCh30. Relating Use CasespCh31. More SSDs and ContractspCh32. Domain Model Refinement1Chapter 30. Relating Use CasesoObjectivesoRelate use cases with include and extend associations, in both text and diagram formats.2IntroductionoUse cases can be related to

2、 each other. nShould that be an include or an extend relationship? nShould we specialize this use caseoOrganizing use cases into relationships has no impact on the behavior or requirements of the system. oGuideline: Avoid Agonizing Over Use Case RelationshipsnThe important use case work: writing use

3、 case textnOften way too much unproductive time is spent debating how to relate use cases in a use case diagram 3The include RelationshipoIt is common to have some partial behavior that is common across several use casesn“paying by credit” occurs in “Process Sale”, “Process Rental”, “Contribute to L

4、ay-away Plan”oFactor out subfunction use cases and use the include relationship when: nSeparate use cases into its own subfunction use case to avoid repetition.nDecompose an overwhelmingly long use case into subunits to improve comprehension.4Example56SummaryoThe include relationship can be used for

5、 most use case relationship problems.oFactor out subfunction use cases and use the include relationship when:nThey are duplicated in other use cases.nA use case is very complex and long, and separating it into subunits aids comprehension.oAs a first rule of thumb, always use the include relationship

6、 between use cases over other relationships.7Terminology: Concrete, Abstract, Base, and Addition Use CasesoA concrete use case is initiated by an actor and performs the entire behavior desired by the actor. nEPB, Process Sale oAn abstract use case is never instantiated by itself; it is a subfunction

7、 use case that is part of another use case nHandle Credit Payment oA use case that includes another use case, or that is extended or specialized by another use case is called a base use casenProcess Sale oThe use case that is an inclusion, extension, or specialization is called an addition use case.

8、 nHandle Credit Payment 8The extend RelationshipoHow to append to the use case without modifying its original text?oUse the extend relationshipnCreate an extending or addition use case, and within it, describe where and under what condition it extends the behavior of some base use case.oExtension po

9、intnLabels in the base use case which the extending use case references as the point of extensionnIndeed, just updating the Extensions section is usually the preferred solution, rather than creating complex use case relationships.910The generalize RelationshipoA common observation by use case consul

10、tants is that complications result and unproductive time is spent on the addition of many use case relationships.11Use Case Diagrams1213Chapter 31. More SSDs and ContractsoObjectivesoDefine SSDs and operation contracts for the current iteration.14NextGen POSoNew System Sequence DiagramsoIn the curre

11、nt iteration, the new payment handling requirements involve new collaborations with external systems.oIt is useful to illustrate the new system events in SSDs in order to clarifynNew system operations that the NextGen POS system will need to supportnCalls to other systems, and the responses to expec

12、t from these calls15Common Beginning of Process Sale Scenario16SSD common beginningCredit Payment SSD17Check payment SSD18New System OperationsoIn this iteration, the new system operations that our system must handle are:nmakeCreditPaymentnmakeCheckPaymentnmakePayment is renamed to makeCashPayment.1

13、9New System Operation Contracts2021Chapter 32. Domain Model RefinementoObjectivesoRefine the domain model with generalizations, specializations, association classes, time intervals, composition, and packages.oIdentify when showing a subclass is worthwhile.22New Concepts for the NextGen Domain Modelo

14、The UP Domain Model may be incrementally developed by considering the concepts in the requirements for this iteration.nConcept Category List nNoun phrase identification 23Noun Phrase Identification from the Use Cases24Noun Phrase Identification from the Use Cases(cont.)25GeneralizationoGeneralizatio

15、n is the activity of identifying commonality among concepts and defining superclass (general concept) and subclass (specialized concept) relationships. oIt is a way to construct taxonomic classifications among concepts which are then illustrated in class hierarchiesoIdentify domain superclasses and

16、subclasses relevant to the current iteration, and illustrate them in the Domain Model.26Generalization-specialization hierarchy27Conceptual Subclass Definition Conformanceo100% Rulen100% of the conceptual superclasss definition should be applicable to the subclass. nThe subclass must conform to 100%

17、 of the superclasss:oattributesoassociations28Conceptual Subclass Set ConformanceoIs-a RulenAll the members of a subclass set must be members of their superclass set.nIn natural language, this can usually be informally tested by forming the statement: oSubclass is a Superclass. (is-a-kind-of)nEg. Cr

18、editPayment is a Payment29What Is a Correct Conceptual Subclass?oapply the following tests to define a correct subclass when constructing a domain modeloA potential subclass should conform to the:n100% Rule (definition conformance)nIs-a Rule (set membership conformance)30When to Define a Conceptual

19、Subclass?oA conceptual class partition is a division of a conceptual class into disjoint subclasses oWhen is it useful to show a conceptual class partition?31Motivations to Partition a Conceptual Class into SubclassesoCreate a conceptual subclass of a superclass when:1.The subclass has additional at

20、tributes of interest.2.The subclass has additional associations of interest.3.The subclass concept is operated on, handled, reacted to, or manipulated differently than the superclass or other subclasses, in ways that are of interest.4.The subclass concept represents an animate thing (for example, an

21、imal, robot) that behaves differently than the superclass or other subclasses, in ways that are of interest32Example subclass partitions33Example subclass partitions(cont.)34When to Define a Conceptual Superclass?oCreate a superclass in a generalization relationship to subclasses when:1.The potentia

22、l conceptual subclasses represent variations of a similar concept.2.The subclasses will conform to the 100% and Is-a rules.3.All subclasses have the same attribute that can be factored out and expressed in the superclass.4.All subclasses have the same association that can be factored out and related

23、 to the superclass.35NextGen POS Conceptual Class HierarchiesoPayment Classes36oAuthorization Service Classes3738oAuthorization Transaction ClassesOne possible class hierarchy for external service transactions39An alternate transaction class hierarchyoAuthorization Transaction ClassesAbstract Concep

24、tual ClassesoIf every member of a class C must also be a member of a subclass, then class C is called an abstract conceptual class.40Abstract Class Notation in the UMLoIdentify abstract classes and illustrate them with an italicized name in the Domain Model, or use the abstract keyword.41Modeling Ch

25、anging StatesoDo not model the states of a concept X as subclasses of X. Rather, either:nDefine a state hierarchy and associate the states with X,ornIgnore showing the states of a concept in the domain model; show the states in state diagrams instead.42Association ClassesoWhere in the UP Domain Mode

26、l should the merchant ID attribute reside?nAuthorization services assign a merchant ID to each store for identification during communications.nA payment authorization request from the store to an authorization service needs the merchant ID that identifies the store to the service.nFurthermore, a sto

27、re has a different merchant ID for each service43Inappropriate use of an attributeFirst attempt at modeling the merchantID problemoIn a domain model, if a class C can simultaneously have many values for the same kind of attribute A, do not place attribute A in C. Place attribute A in another class t

28、hat is associated with C.44An association classoThe merchantID may be thought of as an attribute related to the association between Store and AuthorizationService.45Guidelines for adding association classesoClues that an association class might be useful in a domain model:nAn attribute is related to

29、 an associationnInstances of the association class have a lifetime dependency on the associationnThere is a many-to-many association between two concepts and information associated with the association itself46Some examples of association classes47Aggregation oAggregation is a vague kind of associat

30、ion loosely suggests whole-part relationships nIt has no meaningful distinct semantics in the UML versus a plain associationnFollowing the advice of UML creators, dont bother to use aggregation in the UML; rather, use composition when appropriate.48aggregationCompanyEmployeeCompositionoComposition,

31、also know as composite aggregationna strong kind of whole-part aggregation and is useful to show in some models .oA composition relationship implies that nAn instance of the part (such as a Square) belongs to only one composite instance (such as one Board) at a time nThe part must always belong to a

32、 composite (no free-floating Fingers) nThe composite is responsible for the creation and deletion of its parts49compositionHandFingerHow to Identify CompositionoConsider showing composition when:nThe lifetime of the part is bound within the lifetime of the compositethere is a create-delete dependenc

33、y of the part on the whole.nThere is an obvious whole-part physical or logical assembly.nSome properties of the composite propagate to the parts, such as the location.nOperations applied to the composite propagate to the parts, such as destruction, movement, recording.oOn composition: If in doubt, l

34、eave it out50A Benefit of Showing CompositionoDiscover and show composition because it has the following benefitsnIt clarifies the domain constraints regarding the eligible existence of the part independent of the whole. nIt assists in the identification of a creator (the composite) using the GRASP

35、Creator pattern.nOperations(such as copy and delete) applied to the whole often propagate to the parts.51Composition in the NextGen Domain Model52Time Intervals and Product PricesoIssue of time intervals associated with information, contracts(Fixing an Iteration 1 Error)nSalesLineItems were associat

36、ed with ProductDescriptions, that recorded the price of an itemnWhat is needed is a distinction between the historical price when the sale was made, and the current price53Association Role NamesoA role name identifies an end of an association and ideally describes the role played by objects in the a

37、ssociation54Roles as Concepts versus Roles in Associations55Derived ElementsoA derived element can be determined from othersnAttributes and associations are the most common derived elements. oWhen should derived elements be shown?nAvoid showing derived elements in a diagram, since they add complexit

38、y without new information.nAdd a derived element when it is prominent in the terminology, and excluding it impairs comprehension.Derived Elements5757Derived attributeDerived attribute related to multiplicityQualified AssociationsoA qualifier may be used in an association; it distinguishes the set of

39、 objects at the far end of the association based on the qualifier value.o An association with a qualifier is a qualified association.58Using Packages to Organize the Domain ModeloA domain model can easily grow large enough that it is desirable to factor it into packages of strongly related concepts5

40、9Ownership and ReferencesoAn element is owned by the package within which it is defined, but may be referenced in other packages.nusing the pathname format PackageName:ElementName 60A referenced class in a packagePackage DependenciesoA package dependency indicates that elements of the dependent pack

41、age in some way know about or are coupled to elements in the target package.61How to Partition the Domain ModeloTo partition the domain model into packages, place elements together that:nare in the same subject area - closely related by concept or purposenare in a class hierarchy togethernparticipat

42、e in the same use casesnare strongly associated62Example: POS Domain Model Packages63Core/Misc PackageoInclude widely shared concepts or those without an obvious home64Payments package65Products package66Sales package67Authorization transaction package68Example: Monopoly Domain Model Refinements (Iteration-3)69SummaryoModel refinementnUse case relationshipoInclude, ExtendnSSD and OCnDomain ModeloGeneralizationoAssociation ClassesoAggregation and CompositionoDerived ElementsoQualified AssociationsoPackage70

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 研究生课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号