Full Transcript

6/8/2024 MASTER OF INFORMATION TECHNOLOGY MASTER OF INFORMATION TECHNOLOGY...

6/8/2024 MASTER OF INFORMATION TECHNOLOGY MASTER OF INFORMATION TECHNOLOGY MIT 1204 Tutorial 6 Question 2 Consider the following activities. (i) Refine the use cases to include details of how the user will actually interface with the system and how the system will respond to that to process the business event. (ii) Model object interactions and behaviours that support the use case scenario. (iii) Identify the actors and use cases. Systems Analysis and Modelling Which of above statements is/are activities of Object-Oriented Design? (a) Only (i) Lecture 12 (b) Only (ii) (c) Only (i) and (iii) Answer (d) (d) Only (i) and (ii) Prof. Kapila. Dias 2024 (e) All UNIVERSITY OF COLOMBO SCHOOL OF COMPUTING Master of Information Technology 828 Tutorial 6 Question 3 Tutorial 6 Question 4 Consider the following use case diagram. 3) Which of the following is/are correct regarding Use case modelling? (a) External server actor is a stakeholder who is a primary actor who receives something of measurable from the use case. (b) Primary business actor is a stakeholder that directly interfaces with the system to initiate or trigger the business or system event. (c) Temporal events are business events that are performed or triggered automatically. (d) Include is a relationship between an actor and a use case. (e) Use Case diagrams can be drawn if you are following a non-object-oriented methodology. Which of the following gives the correct matching(s) for A-D? (a) A-Communication, B-Extend, C-Include, D- Association (b) A-Communication, B-Include, C-Extend, D- Inheritance Answer (e) (c) A-Inheritance, B-Extend, C-Inheritance, D- Include Answer (b),(d) (d) A-Association, B-Include, C-Extend, D- Inheritance (e) A-Association, B-Extend, C-Include, D- Inheritance Master of Information Technology 829 Master of Information Technology 830 Tutorial 6 Question 5 Tutorial 6 Question 6 5) Considering the following statements in relation to Use Case 6) Consider the following statements related to Use Case modelling. (i) Business requirements Use Case captures the interactions between a modelling, identify the correct statements. user and the system free of technology implementation details. (a) Use Case is a construct that helps analysts to work with users (ii) Actors are named with a verb phrase specifying the goal of an actor. to determine system usage. (iii) If the system has several subsystems, one may draw several use case (b) Actors may represent anyone or any thing that must interact model diagrams. with the system. Which of the above statements is / are correct? (c) Extends relationship shows the compulsory behavior of a (a) Only (i) Use Case. (b) Only (ii) (d) A scenario is a collection of use cases initiated by an actor. (c) Only (iii) (e) Scenario is another term used for a Use Case. (d) Only (i) and (ii) (e) Only (i) and (iii) Answer (e) Answer (a),(b) Master of Information Technology 831 Master of Information Technology 832 MIT 1204 1 6/8/2024 Tutorial 6 Question 7 Tutorial 6 Question 8 7) Consider the following use case diagram. (8) Which of the following statements is/are correct regarding Use case modelling? (a) When one needs to model things that happen at a specific point of time which are not triggered by any actor in the system, one can introduce an actor called Time or Timer. (b) includes relationship shows the optional behaviour of a Use Case. (c) extends relationship shows the compulsory behaviour of a Use Case. (d) An actor can be another system that connects with the system being Which of the following gives the correct matching(s) for A-D? modelled. (e) System actors should be the users of the intended system being (a) A-Association, B-Association, C-Include, D- Include developed. (b) A-Association, B-Association, C-Extend, D- Include Answer (c) (c) A-Association, B-Association, C-Extend, D- Extend (d) A-Communicate, B-Communicate, C-Inheritance, D- Inheritance Answer (a),(d),(e) (e) A-Communicate, B-Communicate, C-Generalization, D- Generalization Master of Information Technology 833 Master of Information Technology 834 Tutorial 6 Question 9 Tutorial 6 Question 10 (9) Which of the following is/are correct regarding Use case (10) Which of the following statements is/are correct regarding Use modelling? case modelling? (a) Use Cases are the things that the actors can do with the system. (b) The system boundary cannot be identified from a use (a) An actor specifies a role that some external entity adopts case model. when interacting with the system directly. (c) An actor can be any one or any thing that will (b) Extends relationship shows the optional behaviour of a Use interact with the system. Case. (d) In UML 2.0, actors may also represent other (c) Include relationship shows the compulsory behaviour of a subjects, giving you a way to link different use case models. Use Case. (e) Use case modelling is most appropriate for systems (d) A use case describes behaviour that the system exhibits to that are dominated by non-functional requirements. benefit one or more actors. Answer (a),(c),(d) (e) Actor should always be a person. Answer (a),(b),(c),(d) Master of Information Technology 835 Master of Information Technology 836 Tutorial 6 Question 11 Tutorial 6 Question 12 (12) Consider the following use case diagram drawn for a particular scenario. (11) Which of the following is/are correct regarding Use case modelling? (a) Use cases are the best choice for requirements capture when the system Bank network Log onto register Authorize purchase has many types of users to which it delivers different functionality. (b) Actors are always the classes identified in Class Diagrams. (c) Actors are roles played by things external to the system that interact Sell goods Clerk directly with the system. Manager Open store (d) You can find actors by considering who or what users interact directly Restock inventory with the system. Custom er (e) Use case modelling is most appropriate for systems that are dominated by non-functional requirements. What are the system actors in the given Use Case diagram? (a) Clerk, Manager, Customer (b) Clerk, Manager (c) Clerk, Manager, Bank network (d) Clerk, Manager, Bank network, Customer Answer (a),(c),(d) (e) Manager, Bank network, Customer Answer (c) Master of Information Technology 837 Master of Information Technology 838 MIT 1204 2 6/8/2024 Tutorial 6 Question 13 Tutorial 6 Question 14 (13) Examine the following Use Case diagram. The following are three statements based on the use case diagram given above, (i) The trader and the sales person do not play the same role in the system. (14) Consider the following statements related to Use Case Modeling. (ii) Both Analyze Risk and Prize Deal are required to value the deal. (iii) There may not be customers with exceeded limits. (a) Inclusion use case supplies behavior to its base use case. (b) Base use case supplies behavior to its inclusion use case. Which of the following is true about the above statements. (c) When the inclusion use case in a use case diagram finishes, the control returns to the base use case again. (d) A use case diagram graphically describes who will use the system and in what ways the user expects to interact with the system. (e) Use cases are initially defined during the design stage of the life cycle and will be additionally refined in the implementation stage. (a) Only (i). Answer (a),(c),(d) (b) Only (i) and (ii). (c) Only (i) and (iii) (d) Only (ii) and (iii). Answer (b) (e) All Master of Information Technology 839 Master of Information Technology 840 Tutorial 6 Question 15 Tutorial 6 Question 16 (15) Which of the following statements is/are correct with respect to Use case (16) Consider the following statements with respect to Use case modeling. modeling? (i) An automatic system backup that runs every evening can be represented by (a) Use cases are the best choice for requirements capture when the system a Time actor. is dominated by functional requirements.. (ii) Credit bureau authorizing the charging by a credit card is an example for (b) Use cases are the best choice for requirements capture when the system an external server actor. has many types of users to which it delivers different functionality. (iii) Warehouse receiving a package order to prepare a shipment is an example (c) Functional decomposition should not be used when drawing use case for an external receiver actor if the warehouse is outside the scope of the diagrams. (d) Examples of systems where use cases may not be appropriate are system. embedded systems and systems that are algorithmically complex but Which of the above statements is/are correct? with few interfaces. (a) Only (i). (e) Use cases are not good for requirements capture when the system has (b) Only (ii). many interfaces. (c) Only (i) and (ii). (d) Only (ii) and (iii). Answer (a),(b),(c),(d) (e) All Answer (e) Master of Information Technology 841 Master of Information Technology 842 Tutorial 6 Question 17 Tutorial 6 Question 18 (17) Consider the following scenario. (18) Consider the following statement. “Two or more Players are involved in a Play Game functionality. “The lab director does a lab test together with his assistant. The Each Player participates in one Play Game”. assistant always has to write a protocol during the lab test.” Illustrate the above using a UML 2.5 Use Case Diagram. Draw a Use Case model for the above situation. Master of Information Technology 843 Master of Information Technology 844 MIT 1204 3 6/8/2024 Tutorial 6 Question 19 Tutorial 6 Question 20 (19) The relationship in the following diagram means: (20) Consider the following diagram and the statements given below. (i) B can execute the same use cases as A. (ii) B inherits all of A's associations. (iii) A can execute the same use cases as B. Which of the above statement(s) is/are true? (a) B might or might not invoke A (b) A might or might not invoke B (a) Only (i) (c) B is optional behaviour to A (b) Only (ii) (d) B always has to invoke A. (c) Only (iii) (e) A cannot be executed without B (d) Only (i) and (ii) (e) Only (ii) and (iii) Answer (a) Answer (d) Master of Information Technology 845 Master of Information Technology 846 Tutorial 6 Question 21 Tutorial 6 Question 21 (21) Consider the following situation: (21) Consider the following situation: “Mother and the Daughter cook dinner together. Sometimes it is necessary that one “Mother and the Daughter cook dinner together. Sometimes it is necessary that one of them gets curry leaves from the garden.” of them gets curry leaves from the garden.” One needs to model the above situation with a UML 2 Use case diagram. One needs to model the above situation with a UML 2 Use case diagram. The following are three diagrams drawn. The following are three diagrams drawn. (ii) (i) Get Curry leaves actor not clear. Only mother get curry leaves Master of Information Technology 847 Master of Information Technology 848 Discovering Object Interactions using Tutorial 6 Question 21 Behavioral Modeling (21) Consider the following situation: “Mother and the Daughter cook dinner together. Sometimes it is necessary that one Instructional Objectives of them gets curry leaves from the garden.” One needs to model the above situation with a UML 2 Use case diagram. Add scenarios to the system to describe The following are three diagrams drawn. how Use Cases are realized as (iii) interactions among societies of objects Which of the above diagrams is/are correct? Describe a scenario by applying sequence (a) Only (i) (b) Only (ii) diagrams and communication diagrams (c) Only (iii) Answer (c) (d) Only (i) and (ii) (e) Only (i) and (iii) Master of Information Technology 849 850 MIT 1204 4 6/8/2024 Scenarios Scenarios cont… The functionality of the use case is captured in Provides an excellent communication medium the use case narrative flow of events section. to discuss systems requirements with A scenario is an instance of a use case. customers. It is one path through the flow of events for Speaks the language of the end users and the the use case. domain experts. Scenarios document decisions about how the responsibilities specified in the use cases are distributed among the objects and classes in the system. 851 852 Documenting Use Cases Use Case Narratives cont.. Use Case Narratives The Use Case Narratives for a use case is captured in Use Case Narratives : text. Typical contents Whereas scenarios are captured in interaction When and how the use case starts and ends diagrams. What interaction the use case has with the A Use Case Narrative document is created for each actors use case What data is needed by the use case Written from an actor point of view The normal sequence of events for the use The Use Case Narrative for a use case is a description case. of the events needed to accomplish the required The description of any alternate or exceptional behavior of the use case. flows. etc. 853 854 Use Case Narratives cont.. Use Case Narratives cont.. Template Eg. Borrowing Scenario Flow of Events Priority Main Flow Preconditions Librarian enters the borrower id. Primary and other participating actors System checks whether borrower id exist. Trigger Typical Flow of Events If not exist (E-1) end use case. Alternate Courses Else Process Post conditions Check for Overdue Books. are included. If yes (E-2) end use case The flow of events documentation typically is created in the Check Over limit (E-3) Elaboration Phase (a phase in IBM Rational Unified Process) in an iterative manner If yes (E-3) end use case 855 856 MIT 1204 5 6/8/2024 Use Case Narratives cont.. A Library System-Lending Scenario Enter copy id Objects Check Borrow able (E-4) Librarian enters the borrower id. If No (E-4) end use case Librarian Confirm Borrowing (C-5) System checks whether borrower Member Update Borrowed Copy details id exist. Check for Overdue Books. Member , BorrowedCopy Alternate Flows Check Over limit E-1 : Borrower id exist Member, BorrowedCopy E-2 : There are overdue books Enter copy id E-3 : Borrower has already borrowed 5 books (max) Check Copy Borrowable Copy, Book E-4 : Copy is not borrow able C-1 : Confirm borrowing Message box Librarian Confirm Borrowing Update Borrowed Copy details BorrowedCopy 857 858 Documenting Scenarios using Interaction A Library System-Reservation Scenario Diagrams Librarian/Member enters the Objects ▪ The flow of events for a use case is captured in text, borrower id. ▪ Where as scenarios are captured in Interaction System checks whether borrower Member diagrams. ▪ UML 1.x uses two types of Interaction Diagrams id exist. Member , BorrowedCopy Sequence Diagrams, Check for Overdue Books. Collaboration/Communication Diagrams Enter Book id ▪ UML 2.0 introduces 2 more. Check Book has Borrowable Copies Copy, Book timing, interaction overview Librarian Confirm Reservation ▪ Each Diagram is a graphical view of the scenario Update Borrowed Copy details ▪ Typically associated with Use Cases in the model ReservedCopy 859 860 Sequence Diagrams Sequence Diagrams cont.. Shows object interactions arranged in In UML, an object in a sequence diagram is time sequence. drawn as a rectangle, containing the name of Shows the objects and classes involved in the object, underlined. the scenario. An object can be named in one of the three Shows the sequence of messages ways: exchanged between the objects needed Object name, to carry out the functionality of the Object name and its class, scenario. Class name (anonymous object) 861 862 MIT 1204 6 6/8/2024 Sequence Diagrams cont.. Sequence Diagrams and Boundary classes UML Notation for objects and messages in a Boundary classes are added to sequence diagrams to show the interaction with the user or sequence diagrams is shown below: another system. ACCNo-3545 : During the early analysis phases, boundary :Borrower Borrowed Copy classes are shown on a sequence diagram only to capture and document the interface requirements. getOverdueDetails Actual messages from the actor to boundary class with their sequencing information will depend on the application framework that will be selected later in development. Messages between objects 863 864 System Sequence Diagrams System Sequence Diagrams A tool used by some Analysts in logical design Boundary object phase is the system sequence diagram. It helps us to identify the high level messages that enter and exit the system. Later these messages will become the messages responsibility of individual objects. Actor These individual objects will fulfill those responsibilities by communicating with other return messages objects. 865 866 Use Case Narratives cont.. Eg. System Sequence Diagram Ref 1. pg395 Eg. Borrowing Scenario Flow of Events Main Flow Librarian enters the borrower id. System checks whether borrower id exist. If not exist (E-1) end use case. Else Process Check for Overdue Books. If yes (E-2) end use case Check Over limit (E-3) If yes (E-3) end use case 867 868 MIT 1204 7 6/8/2024 Use Case Narratives cont.. System Sequence Diagram for Borrowing Scenario Enter copy id Check Borrow able (E-4) If No (E-4) end use case Librarian Confirm Borrowing (C-5) Update Borrowed Copy details Alternate Flows E-1 : Borrower id exist E-2 : There are overdue books E-3 : Borrower has already borrowed 5 books (max) E-4 : Copy is not borrow able C-1 : Confirm borrowing Message box 869 870 Lending Interface 1 Lending Interface 3 Lending Interface 2 Master of Information Technology 871 872 General activities in performing OOA Modeling the functions of the system Refine the requirements use case model and use case narratives, Model the use case activities (draw activity diagrams), Draw system sequence diagram , Finding and Identifying the Business Objects that represent the entities in the problem domain. These objects are typically nouns in the requirements documents. Noun analysis, CRC analysis Organizing the Objects and Identifying the Relationships. Determining how objects interact with each other, including relationships such as associations, aggregations, Lending interface 4 compositions, and inheritance. Identify types of relationships between the objects. Class diagram with problem domain classes. Developing Interaction Diagrams: eg. Creating sequence diagrams to depict the interactions between objects to achieve specific use cases. Validating the Models Ensuring that the object model accurately represents the system requirements and is feasible for implementation. This may involve reviewing the model with stakeholders and conducting walkthroughs or simulations. 873 874 MIT 1204 8 6/8/2024 Borrowing Sequence Diagram with objects and messages Borrowing Sequence Diagram with objects and messages 875 876 Borrowing Sequence Diagram with objects and messages Borrowing Sequence Diagram with objects and messages 877 878 Another Example Borrowing Sequence Diagram After mapping objects to classes and messages to methods 879 880 MIT 1204 9 6/8/2024 Sequence Diagrams cont.. Sequence Diagrams cont.. How Complex can a sequence How to handle conditional logic? diagram be? ( if, then, else logic that exists in the real Keep them simple world) If the logic is simple, involving only a few Then it is easy to see: messages, the objects, add the logic to one diagram, and use notes to communicate the choices to be made. object interactions, If the logic is complex, involves complicated the messages between the objects, messages, and draw a separate diagram- one for the if case, one for the then case, and one for the else the functionality captured by the case. scenario. This is done to keep the diagrams simple. 881 882 Sequence Diagrams cont.. Sequence Diagrams cont.. In most I-CASE tools, diagrams may be linked Let us look at the Order Proceesing example: Purchase Items to one another. - Customer confirms items in the Shopping Cart and creates a This allows the user to navigate through a set new order of diagrams - Add different items to the order. Customer provides payment and address to process sales - System validate payment Information and respond with confirmation of order and provides order number that customer can use to check on order status. - System will send confirmation of order details to customer in an email. 883 884 Sequence Diagrams cont.. Response done using Dash Arrow 885 886 MIT 1204 10 6/8/2024 Focus of Control (Activation Bar) Focus of Control cont… The focus of control is a small rectangle, that will let you know which object has control at a particular point in time. This is one of the differences between Sequence and a Communication diagram. The focus of control is shown only on a sequence diagram. (optional) :Lecturer Math 1101 - Section1 : CourseManager CourseOffering Focus of Control Add Lecturer 887 888 Collaboration Diagrams/Communication Collaboration Diagrams /Communication Diagrams Diagrams cont.. ▪ An alternative way to show a scenario. UML Notation for objects, links and Messages in ▪ Shows Object interactions organized around the a communication diagram. objects and their links to each other. ▪ A communication diagram contains: :LecturerCourseManager Objects drawn as rectangles. 1:Add Lecturer Links between objects shown as lines connecting the 3:Delete Lecturer linked objects. Messages shown as text and an arrow that points from the Math 101-Section 1:CourseOffering client to the supplier. 889 890 Collaboration Diagrams /Communication Collaboration Diagrams /Communication Diagrams cont.. Diagrams cont.. Why do you need two different diagrams? Collaboration Diagrams/Communication Sequence diagrams : Diagrams: Show a scenario in a time based order – what Tend to provide the big picture for a scenario. happens first and what happens next. Organized around the object links to one Customers can easily read and understand another. sequence diagrams. Used more in the design phase of development Useful in early analysis phases. 891 892 MIT 1204 11 6/8/2024 Collaboration Diagrams /Communication Diagrams cont.. Corresponding sequence diagram 1: Enter borrower id 2: checkBorrowerExist( ) 3: process 4: checkOverdue( ) 7: Enter copy i d 6: checkOverli mit( ) 11: confirm borrowi ng borrowing 12: i nformBorrower( ) form a borrower : borrower : l ibrari an 5: getOverdueDetails( ) 13: i nformBorrowedCopy( ) 8: checkCopyExist( ) 10: checkBorrowabl e( ) a borrowed copy : a book : borrowedCopy book 9: getBookDetai ls( ) a copy : copy 893 894 Message Numbering in a Communication Types of message in UML 2.* Diagram Sequence diagram is read from top to bottom. So Message numbering is not necessary. A Communication diagram, however losses its sequencing information, if you do not have message numbering. Message numbering can be turn on/off in modeling tools. 895 896 Self message(non recursive) vs self recursive message A self message is a message that an object sends to itself. It is a message that represents the invocation of message of the same lifeline. A self message can represent a recursive call of an operation, or one method calling another method belonging to the same object. 897 898 MIT 1204 12 6/8/2024 Self Message (Recursive) –C++ example Self Message (Recursive) 899 © e-Learning Centre, UCSC 900 Self message(non recursive) vs self recursive message Message Constraints Message interactions happen only if the condition is true Non Recursive Recursive 901 902 Eg. Sequence Diagram: Add Details of a new Course Framing in Sequence Diagrams UML 2.* feature One can frame a sequence diagram by surrounding it with a border and adding a compartment in the upper left corner. The compartment contains information that identifies the diagram. These interaction fragments can be combined. Gives you a quick and easy way to reuse part of one sequence diagram in another. Ref. http://www.youtube.com/watch?v=4WDbte6cPa8 903 904 MIT 1204 13 6/8/2024 Draw a User Interfaces for Borrowing Use Case Enter copy id Check Borrow able (E-4) If No (E-4) end use case Librarian Confirm Borrowing (C-5) Update Borrowed Copy details Alternate Flows E-1 : Borrower id does not exist E-2 : There are overdue books E-3 : Borrower has already borrowed 5 books (max) Borrowing Sequence Diagram with objects and messages E-4 : Copy is not borrow able C-1 : Confirm borrowing Message box 905 906 Borrowing Sequence Diagram with objects and messages Master of Information Technology 907 Master of Information Technology 7 June 2024 908 Master of Information Technology 7 June 2024 909 Master of Information Technology 7 June 2024 910 MIT 1204 14 6/8/2024 Working with State Diagrams Working with State Diagrams Use Cases and Scenarios provides a way to describe As the system interacts with users and other systems, system behaviour. The objects that make up the system go through necessary Use Case – Typical interaction between a user an a changes to accommodate the interactions. computer system. If you are going to model systems, you must have a Scenario – Instance of a Use Case mechanism to model change. Interaction Diagrams – Capture Scenarios. One way to characterize change is to say that its Shows object interactions arranged in time sequence. objects change their state in response to events and Some times it is necessary to look at the behaviour to time. inside an object. 911 912 Working with State Diagrams Working with State Diagrams Examples: UML State Transition Diagrams shows: When you throw a switch, a light changes its state from Off Life history showing the different states of a given to On. object. After an appropriate amount of time, a washing machine The events or messages that cause a transition changes its state from Washing to Rinsing. from one state to another. Hotel room changes its state to available, reserved and The actions that results from a state change. occupied. State Diagrams are created only for classes UML State diagram captures these kinds of changes. with significant dynamic behaviour. eg. Hotel Room in a Hotel Reservation System 913 914 Modeling Dynamic Behaviour States Interaction diagrams can be studied to Condition or Situation during the life of an object determine the dynamic objects. Objects receiving and sending many messages. eg. HotelRoom object can be in one of the following states. If you have an attribute called status. Occupied, Available, Reserved This can be a good indicator of various states. eg. Course object (in a course registration system) can be in one of the following states. Initialization,Open, Close,Cancel UML Notation for a State 915 916 MIT 1204 15 6/8/2024 State Transitions Special States A State Transition represents a change from an originating There are two special states that are added to the state state to a successor state. transition diagram. An action can accompany a state transition. Start state – Each diagram must have one and only one start A State Transition is represented by an arrow that points from state. the originating state to the successor state. Stop state – An object can have multiple stop states. UML Notation for State Transition Start State Stop State 917 918 State Transition Diagram –Hotel Room Class Hotel Room – Another example 919 920 State Transition Diagram– Course Class State Transition Details A State Transition may have the following associated with: Initialization Closed an action and/or (behaviour that occurs when the state transition occurs.) add student cancel a guard condition closed cancel (allows state transition only if it is true.) cancel Open Canceled A State Transition may also trigger an event A message that is sent to another object in the system. add student 921 922 MIT 1204 16 6/8/2024 State Transition Diagram Course Offering with State Details Add student[ count < 10 ] State Details Add Student / Initialization Set count = 0 Open do: Initialize course entry: Register student Activity : behaviour that an object carries out while it exit: Increment count is in a particular state. Cancel An activity is shown inside the state itself, preceded by the Cancel [ count = 10 ] word do and a colon. Canceled Entry Action : do: Notify registered students Closed Behaviour that occurs while the object is transitioning into Cancel do: Finalize course the state. Shown inside the state, preceded by the word entry and colon. 923 924 State Details cont… State Details con… Exit Action : occurs as part of the transition out of a In this case, the activity, entry action, or exit action is state. preceded by a ^ Shown inside the state, preceded by the word exit and Do:^Target.Event(Arguments) colon. Target - object receiving the event The behaviour in an activity, entry action, or exit Event - message being sent action can include sending an event to some other Arguments – parameters of the message being sent object. Eg. Do:^CourseRoster.Create 925 926 UML 2.0 State Diagrams UML 2.0 State Diagrams UML 2.0 has added some new state relevant symbols At first the book is residing on a shelf. called connection points. If a borrower has called in to reserve the book, a They represent points of entry into a state or exists librarian retrieves the book and brings it into the out of a state. state of “Being checked out”. If a borrower comes to the library, browses through Lets look at the different state of a book in a library. the shelves, selects the book, and decides to borrow it. Again it enters into the state of “Being checked out”, but in a different way. 927 928 MIT 1204 17 6/8/2024 Entry points and exit point in a UML state UML 2.0 State Diagrams diagram You can think of each way of getting to the Being- checked-out state as going through a separate entry point Suppose the borrower is trying to borrow more than [reserved] the allotted limit or has number of unpaid fines. Being Checked Out If that is the case the book abruptly exits via an exit Residing on shelf ended point, from “Being-checked-out” state 929 930 Why are State diagrams important? Why are State diagrams important? They model the changes that just Developers, in particular, have to know one object goes through. how objects are supposed to behave They help analysts, designers, because they have to implement these and developers understand the behaviors in software. behavior of the objects in a It is not enough to implement only system. objects. A Class diagram and an object Developers have to make that object do diagram show only static aspects something. of a system. They do not show the dynamic details of the State diagrams ensure that they won’t behaviors. have to guess about what the object is supposed to do. 931 932 MIT 1204 18

Use Quizgecko on...
Browser
Browser