Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Detail Design: Use-Case Design. 24 2 Background on Use Case Design Have ‘done’ Architectural Design; You know the major (eleven) precepts of good design.

Similar presentations


Presentation on theme: "1 Detail Design: Use-Case Design. 24 2 Background on Use Case Design Have ‘done’ Architectural Design; You know the major (eleven) precepts of good design."— Presentation transcript:

1 1 Detail Design: Use-Case Design

2 24 2 Background on Use Case Design Have ‘done’ Architectural Design; You know the major (eleven) precepts of good design. Now, we drop down a level to Detail Design Now:  Use Case Design;  Subsystem Design, and  Class Design. All are very different and satisfy different purposes. After class design, you are ready to code.

3 24 3 Objectives: Use-Case Design (1 of 2) Start of ‘Detail Design’ – right above coding. Verify consistency in use-case implementation  1. Verify that all necessary behaviors cited in the use case narratives have been distributed along the participating classes See use case narratives and interaction diagrams  2. Verify that all associations between design elements (classes and subsystems in layers and other components) needed for the use case realizations have been defined, See layer architecture and components therein.

4 24 4 Objectives: Use-Case Design (2 of 2)  3. Verify that all of the attributes needed for the use cases have been defined and found in domain models, glossary, etc.. See class diagrams  4. Refine the Use-Case Realizations (boundary, control, entity classes and subsystems interfaces) from Use-Case Analysis into design model elements  5. Ensure application architectural mechanisms (persistence, security, etc.) are incorporated into the use case realizations. Use Case Realizations are captured via software class diagrams and interaction diagrams for various scenarios.

5 24 5 Use-Case Design in Context Architect Designer Architectural Analysis Architecture Reviewer Review the Design Review the Architecture Use-Case Analysis Architectural Design Describe Concurrency Describe Distribution Class Design Subsystem Design Use-Case Design Reviewer Here is our workflow suggested by the Unified Process. Note ‘designer’ activities are related to architecture - but quite different from architect Important to note detailed design activities (Use Case, Subsystem, and Class Design) are tightly bound and tend to alternate between one another.

6 24 6 Lastly, and very importantly: Note: one of the major differences between use case analysis (what we have done) and use case design (what we are embarking upon) is scale.  Analysis classes may be quite large Lots of attributes This keeps the analysis model small.  Analysis interaction diagrams are quite easy to read and understand and most people will grasp the whole model. Model is rather small and conceptual! Model does NOT represent an implementation. (design)

7 Use Case Design - Guidance Use Case Design Steps:  Describe interactions between design objects  Simplify interaction diagrams using subsystems & interfaces  Will ratchet down in Subsystem Design and Class Design Let the Use Case ‘drive’ the design process  Ensure interaction diagrams do their job!  Ensure interaction diagrams model the desired behaviors (via requirements) through responsibilities (in design) 24 7

8 8 Use-Case Design Overview Supplementary Specifications Use-Case Design Use-Case Realization Design Subsystems and Interfaces Design Classes Use Case

9 24 9 Use-Case Realization – UML Notation Class Diagrams Sequence Diagrams Use Case Use-Case ModelDesign Model Use CaseUse-Case Realization Communications Diagrams Designer is responsible for the integrity of the use case realization. Must coordinate with Architect. Interaction Diagrams: Use Case Realization:

10 24 10 Use-Case Design Steps  Describe Interactions Between Design Objects  Involves replacing analysis classes with design elements.  Replace boundary classes (analysis) with subsystems; Such as GUI classes for boundary classes for a View  Replace external actors (e.g. external device or a system that manages a database) with an interface to the class; Will show this ahead…  Note: a number of analysis entities may prevail, although perhaps be fewer in number or adjusted. In Analysis Interaction Diagrams…  Replace applicable classes (boundary, control, …) with an associated subsystem interface  We are saying that an analysis class (in the analysis model) may often be best implemented via a subsystem in the design model. (Actually makes our job easier via abstraction)

11 24 11 BillingSystem // submit bill() > BillingSystem > IBillingSystem CourseCatalogSystem // get course offerings() > CourseCatalogSystem > ICourseCatalogSystem Analysis ClassesDesign Elements Ex: Incorporating Subsystem Interfaces getCourseOfferings(forSemester : Semester) : CourseOfferingList submitBill(forTuition : Double, forStudent : Student) Note: Interactions to support external system access will be more complex than can be implemented in a single class. So, we identified subsystems to encapsulate this access to external systems. So this type of e boundary class (in analysis) typically morphs into a subsystem in the Design Model. Using a subsystem as the interface to the Billing System.

12 24 12 Recall: We had: : Course Catalog System > : Course Catalog Actor (hence external) This actor represents the system that manages the Course Catalog, etc. Data is out ‘here.’ Our analysis class below: Sequence Diagram

13 24 13 Ex: Incorporating Subsystem Interfaces (before) Replace with subsystem interface : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : CourseCatalogSystem A list of the available course offerings for this semester are displayed Student wishes to create a new schedule 1. // create schedule( ) 1.2. // display course offerings( ) 1.1. // get course offerings( ) 1.1.1. // get course offerings(forSemester) 1.3. // display blank schedule( ) 2. // select 4 primary and 2 alternate offerings( ) 2.1. // create schedule with offerings( ) 2.1.1. // create with offerings( ) A blank schedule is displayed for the students to select offerings 2.1.2. // add schedule(Schedule) At this point, the Submit Schedule subflow is executed We know from Architectural Design that a CourseCatalogSystem Actor has been defined to represent the external legacy Course Catalog System. So, we need to refine interaction diagram and replace the CourseCatalogSystem boundary class (from analysis) with the associated subsystem interface, ICourseCatalogSystem, here in design.

14 24 14 Ex: Incorporating Subsystem Interfaces (after) : Student : RegisterFor CoursesForm : Registration Controller : Schedule : Student : ICourseCatalog System A list of the available course offerings for this semester are displayed Student wishes to create a new schedule 1: // create schedule( ) 1.2: // display course offerings( ) 1.1: // get course offerings( ) 2.1.2: // add schedule(Schedule) 1.1.1: getCourseOfferings(Semester) 1.3: // display blank schedule( ) At this, point the Submit Schedule subflow is executed. 2: // select 4 primary and 2 alternate offerings( ) 2.1: // create schedule with offerings( ) 2.1.1: // create with offerings( ) A blank schedule is displayed for the students to select offerings Replaced with subsystem interface Show here how interactions are modeled between design elements where one element is a subsystem. Original use-case realization from Analysis was refined and original boundary class replaced with the associated subsystem interface, ICourseCatalogSystem Access to the Catalog system is represented via an interface to that subsystem… Now a Design element

15 24 15 More on interaction diagrams In Use Case Design, we do not flush out the internals of the CourseCatalogSystem subsystem. How the subsystem accesses the external system that manages the Catalog is abstracted here and represented only by an interface to the subsystem. The subsystem’s job is to connect to the external system. This part of the Use Case Design sequence diagram will become the subsystem context diagram in Subsystem Design coming up When we take on Subsystem Design we will have to design the internals of every subsystem we abstract using only its interface here.

16 24 16 Ex: Incorporating Subsystem Interfaces - (VOPC) ICourseCatalogSystem getCourseOfferings() initialize() (from External System Interfaces) > RegisterForCoursesForm // submit schedule() // display course offerings() // display schedule() // save schedule() // create schedule() // select 4 primary and 2 alternate offerings() // display blank schedule() (from Registration) > Student. - name - address - studentID : int // addSchedule() // getSchedule() // hasPrerequisites() // passed() (from University Artifacts) > RegistrationController // submit schedule() // save schedule() // create schedule with offerings() // getCourseOfferings() (from Registration) > 0..1 registrant 11 Schedule semester // submit() // save() // any conflicts?() // new() (from University Artifacts) > 0..* 1 0..1 currentSchedule CourseOffering number startTime endTime days // addStudent() // removeStudent() // new() // setData() (from University Artifacts) > 0..* 0..4 primaryCourses 0..* 0..2 alternateCourses 0..* 1 Subsystem interface The above example is the VOPC after incorporating the design elements. The original CourseCatalogSystem boundary class has been replaced with the associated subsystem interface, ICourseCatalogSystem. Static part:

17 24 17 Use-Case Design Steps - continued  Simplify Interaction Diagrams Using Subsystems  When a use case is realized (that is, ‘design’), the flow of events is usually described in terms of executing objects; that is, as interactions between design objects.  Often useful to encapsulate a sub-flow of events within a subsystem. (below and next slide)  If done, large subsections of the interaction diagram are replaced with a single message to the subsystem.  This simplifies our first cuts at use-case design and resulting interaction diagrams.  Subsystem interaction diagrams are later developed during Subsystem Design and will illustrate the internal interactions needed to produce each of these desired behaviors.

18 24 18  Raises the level of abstraction Encapsulating Subsystem Interactions Interactions can be described at several levels  Lifelines in the middle represent sub-states;  Interactions in circles represent the internal interaction of subsystem members in response to the message. Subsystem interactions can / will be described in their own interaction diagrams

19 24 19 Encapsulate Sub-Flows in a Subsystem When a: Sub-flow occurs in multiple use-case realizations Sub-flow occurs only in one use case realization, but:  Sub-flow has reuse potential  Sub-flow is complex and easily encapsulated (abstract out the behaviors for now…)  Sub-flow is responsibility of one person/team  Sub-flow produces a well-defined result Make sure what you are abstracting is worth abstracting. There’s no free lunch!

20 24 20 > MySubsystem InterfaceA op1() Op1() :InterfaceA Guidelines: Encapsulating Subsystem Interactions Subsystems should be represented ONLY by their interfaces on interaction diagrams in use case design (here) Messages to subsystems are modeled as messages to the subsystem interface only.  Thus any subsystem that realizes the interface can be substituted for the interface in diagram (later).

21 24 21 Guidelines: Messages sent From Interfaces Messages to subsystems correspond to operations of the subsystem interface (the signatures) Interactions within subsystems will be modeled in Subsystem Design Very powerful statements here: Discuss real meanings! In many cases, the interface lifeline does not have messages going out from it, since different subsystems realizing the interface may send different messages. However, if you want to describe what messages should be sent (or are allowed to be sent) from any subsystem realizing the interface, such messages can go out from the interface lifeline.

22 24 22 Principle: “Design by Contract” With this approach, when describing the interactions, the focus remains concentrated on the services, NOT on how the services are implemented (realized) within design elements. This is known as “Design by Contract” and is one of the core tenets of robust software development using abstraction and encapsulation mechanisms. Describing HOW the services are implemented is the focus of Subsystem Design (for the design subsystems) and Class Design (for the design classes).

23 24 23 Advantages of Encapsulating Subsystem Interactions via Interfaces Use-case realizations are less cluttered – especially if the internal design of subsystem in complex. Use-case realizations can be created before the internal designs of subsystems are created (parallel development)  Ensures the use case functionality hasn’t been lost between allocation of use-case responsibility (in Use Case Analysis) and the identification of design elements (subsystems and design classes) in Architectural Design, and before Subsystem Design is performed. Use-case realizations are more generic and easy to change (subsystems can be substituted) Again, encapsulating subsystem interactions raises the level of abstraction of the use-case realization flows of events.

24 24 Parallel Subsystem Development IF we are developing subsystems more or less independently, first find subsystem dependencies by identifying the interfaces between them. How? Approach:  Concentrate on requirements that affect subsystem interfaces  Outline required interfaces  Show messages that are going to pass over the subsystem borders…  Draw interaction diagrams in terms of subsystem interfaces for each use case  Refine the interfaces needed to provide messages  Develop each subsystem in parallel – using the interfaces as synchronization instruments between development teams.

25 24 25 May decide to arrange the interaction diagrams in term of subsystems or in terms of their interfaces only. In some projects, it might be necessary to implement the classes providing the interfaces before you continue with the rest of the modeling. The detailed design of the subsystem “internals” is done during Subsystem Design. Interfaces are what ensure compatibility between the Use-Case Design and Subsystem Design. Parallel Subsystem Development


Download ppt "1 Detail Design: Use-Case Design. 24 2 Background on Use Case Design Have ‘done’ Architectural Design; You know the major (eleven) precepts of good design."

Similar presentations


Ads by Google