Phân tích thiết kế hướng đối tượng - Chương 3.4 (HUST) GV.Phạm Ngọc Nam

LI
lienhejb
0 téléchargements
32
0

Contenu du document

Page 1

goupee.vn TRƢỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI goupee.com KHOA ĐIỆN TỬ VIỄN THÔNG PHÂN TÍCH THIẾT KẾ HƢỚNG ĐỐI TƢỢNG CHƢƠNG 3. Phân tích Bộ môn Điện tử tin học fb.com/goupee.vn04/2007 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 2

goupee.vn goupee.com Chƣơng 3. Phân tích  3.1. Xác định rõ yêu cầu  3.2. Mô hình hóa chức năng  3.3. Mô hình hóa cấu trúc  3.4. Mô hình hóa hoạt động fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 3

goupee.vn goupee.com Introduction  Last two chapters:  Use Case  External Behavior (how the system is used)  Structural Model  Static View of system (how the system is structured)  This Chapter  Behavioral Model (how the system behaves)  Internal behavior  Dynamic view of the information system fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 3 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 4

goupee.vn goupee.com Introduction  We'll look at two types of Behavioral Models:  For Business Processes  Sequence and collaboration diagrams  For Changes in underlying data  Statechart diagrams fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 4 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 5

goupee.vn goupee.com Key Ideas  Behavioral models describe the internal dynamic aspects of an information system that supports business processes in an organization  Key UML behavioral models are: sequence diagrams, communication diagrams, and state machine diagrams fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 5 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 6

goupee.vn goupee.com Behavioral Models  Purpose of Behavioral Models  Show how objects in the structural model collaborate to support each use case  Depict the internal view of the business process  To show the effects of varied processes on the system  To be used to verify and modify functional and structure models  Types of Behavioral Models  Interaction Diagrams  Behavioral state machine diagram fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 6 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 7

goupee.vn goupee.com Interaction Diagrams  Interaction Diagrams  sequence diagrams  communication diagrams  Interaction Diagram Components  Objects  Instantiation of a class  Has attributes that describe an object  Operations  Send and receive messages  Messages  Tell object to execute a behavior fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 7 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 8

goupee.vn goupee.com Sequence Diagrams  Illustrate the objects that participate in a use-case  Show the messages that pass between objects for a particular use-case fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 8 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 9

goupee.vn goupee.com Elements of Sequence Diagram fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 9 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 10

goupee.vn goupee.com Elements of Sequence Diagram fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 10 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 11

goupee.vnAn Example of Sequence Diagrams goupee.com fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 11 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 12

goupee.vn goupee.com Building a Sequence Diagram  Determine the context of the SD  A system, use case, use case scenario, or class method  Identify the participating objects  Developed in structural model  Set the lifeline for each object (dotted lines)  Add messages (horizontal arrows)  Place the focus of control on each object’s lifeline (when the classes send/receive)  Validate the sequence diagram fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 12 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 13

Application goupee.vn goupee.com Example: Normal Flow of Events: 1. Customer submits a search request to the system. 2. The system provides the customer a list of recommended CDs. 3. The customer chooses one of the CDs to find additional information. 4. The system provides the customer with basic (market) information & CD Reviews 5. The customer calls the maintain order use case. 6. The customer iterates over 3 through 5 until finished shopping. 7. The customer executes the checkout use case. 8. The customer leaves the website. fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 13 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 14

Application goupee.vn goupee.com Example: fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 14 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 15

goupee.vn goupee.com Collaboration Diagrams fb.com/goupee.vn CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 16

goupee.vn goupee.com Collaboration Diagrams  Essentially an object diagram that shows  Message passing relationships  Instead associations  Emphasize  The flow of messages among objects  Rather than timing and ordering of messages fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 16 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 17

Example Collaboration Diagram goupee.vn goupee.com fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 17 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 18

goupee.vn goupee.com Elements of a Collaboration Diagram Actor Object Association Message fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 18 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 19

goupee.vn goupee.com Building Collaboration Diagrams 1. Set the context. 2. Identify which objects (actors) and the associations between the objects participate in the collaboration. 3. Layout the communication diagram. 4. Add messages. 5. Validate the communication diagram. fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 19 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Page 20

Technique to Identify Collaborations goupee.vn goupee.com between Objects - “CRUD” Analysis  What is “CRUD” analysis:  identifying the processes to Create, Read or Reference, Update or Delete objects based on use cases  The process of each user case is represented by “CRUD” matrix: a class-by-class matrix in which each cell in the matrix represents the interaction between instances of the classes fb.com/goupee.vn October 20 OOD - DEI.FET.HUT 20 CuuDuongThanCong.com https://fb.com/tailieudientucntt

Affichage des 20 premières pages. Téléchargez le document pour le voir en entier.

Commentaires (0)

Se connecter pour rejoindre la discussion

Aucun commentaire pour le moment. Soyez le premier !