SlideShare a Scribd company logo
VIỆN KHOA HỌC VÀ CÔNG NGHỆ VIỆT NAM
    VIỆN CÔNG NGHỆ THÔNG TIN




PHÂN TÍCH THIẾT KẾ
HƯỚNG ĐỐI TƯỢNG

     PGS.TS. Đặng Văn Đức
   Email: dvduc@ioit.ncst.ac.vn
NỘI DUNG

  1. Tiến trình phát triển phần mềm theo hướng đối tượng
        Giới thiệu Ngôn ngữ mô hình hóa thống nhất UML
  3. Mô hình hóa nghiệp vụ
  4. Mô hình hóa trường hợp sử dụng
  5. Mô hình hóa tương tác đối tượng
  6. Biểu đồ lớp và gói
  7. Biểu đồ chuyển trạng thái và biểu đồ hoạt động
  8. Biểu đồ kiến trúc vật lý và phát sinh mã trình
  9. Mô hình hóa dữ liệu
  10. Bài học thực nghiệm

dvduc-2004            Phân tích thiết kế hướng đối tượng   Bài 2 - 2/43
Bài 2

          Giới thiệu
Ngôn ngữ mô hình hóa thống nhất
Mô hình là gì?
      Mô hình
             là bức tranh hay mô tả vấn đề đang cố gắng giải quyết hay mô tả
             chính giải pháp vấn đề
             là ngôn ngữ của người thiết kế (trong nhiều lĩnh vực)
             là trình diễn hệ thống sẽ xây dựng
             là phương tiện giao tiếp giữa các stakeholders
             là kế hoạch chi tiết (blueprints)
      Mô hình cho khả năng suy diễn một số đặc tính của hệ thống thực
      Mô hình hóa trực quan
             Bằng các phần tử đồ họa
      Ngôn ngữ mô hình hóa là ngôn ngữ mô tả hệ thống hay tác nghiệp

                    An abstraction is an intellectual simplification

dvduc-2004                        Phân tích thiết kế hướng đối tượng    Bài 2 - 4/43
Thí dụ mô hình



                                                                           Mô hình: Quả địa
                                                                             cầu học sinh
                   Thế giới thực




                                                                               Thế giới thực



                        Làm chủ                       Đọc           Sách
                                     Con người
             Ôtô                                                               Mô hình




dvduc-2004                     Phân tích thiết kế hướng đối tượng                          Bài 2 - 5/43
Thí dụ mô hình




A model is a complete
description of a system
from a particular
perspective

dvduc-2004                Phân tích thiết kế hướng đối tượng   Bài 2 - 6/43
Mô hình hóa trực quan?

                                             “Modeling captures essential
                        Order
                                                     parts of the system.”
                                                                       Dr. James Rumbaugh
              Item


             Ship via

             Business Process



      Visual Modeling is modeling
      using standard graphical
                                                                     Computer System
      notations


dvduc-2004                      Phân tích thiết kế hướng đối tượng                 Bài 2 - 7/43
Bốn nguyên tắc mô hình hóa

      Việc chọn mô hình nào để tạo lập có ảnh hưởng sâu sắc
      đến cách giải quyết vấn đề và cách hình thành các giải
      pháp
      Mỗi mô hình biểu diễn hệ thống với mức độ chính xác
      khác nhau
      Mô hình tốt nhất phải là mô hình phù hợp với thế giới
      thực
      Không mô hình nào là đầy đủ. Mỗi hệ thống thường
      được tiếp cận thông qua tập mô hình gần như độc lập
      nhau.

dvduc-2004             Phân tích thiết kế hướng đối tượng   Bài 2 - 8/43
Thiết kế kiến trúc
                                                                                           The “why”
         The “what”
                                                                                          System
                  Architecture                       Satisfies                            Features
                   Qualities
                                                                              S/W
 Architecture
                                                                           Requirements
                                                     Constrain
                  Architecture
                 Representation                                                          System
                                                                                     Quality Attributes

                                                    Technology
                        Produces                                                Defines
                                                                                           The “how”
         The “who”
                                                       Follows
                  Architect                                                         Process

                                           Skills
                                                                 Defines role
                                                                                   Organization
                Stakeholders


dvduc-2004                         Phân tích thiết kế hướng đối tượng                           Bài 2 - 9/43
Ngôn ngữ mô hình hóa thống nhất

                                                                               UML 1.3
                 OMG Acceptance, Nov 1997
                                                                           UML 1.1
                 Final submission to OMG, Sep ‘97
   public        First submission to OMG, Jan ´97
feedback
                                                             UML 1.0
                 UML partners


                                                    UML 0.9
                 June ´96
                                                                                 June 12, 2003
                                                                                   UML 2.0
                                     Unified Method 0.8
             OOPSLA ´95




                            Booch method                          OMT           OOSE
   Other methods

                            UML stands for Unified Modeling Language
    dvduc-2004                        Phân tích thiết kế hướng đối tượng                Bài 2 - 10/43
UML Partners
             Rational Software Corporation
             Hewlett-Packard
             I-Logix
             IBM
             ICON Computing
             Intellicorp
             MCI Systemhouse
             Microsoft
             ObjecTime
             Oracle
             Platinum Technology
             Taskon
             Texas Instruments/Sterling Software
             Unisys
dvduc-2004              Phân tích thiết kế hướng đối tượng   Bài 2 - 11/43
Contributions to the UML
                                             Harel
                      Meyer                                        Gamma, et al
                                           Statecharts
                  Before and after                             Frameworks and patterns,
                     conditions
                                                                                      HP Fusion
                                                                              Operation descriptions and
           Booch                                                              message numbering
     Booch method

                                                                                        Embley
Rumbaugh                                                                           Singleton classes and
Object Modeling                                                                    high-level view
  Technique

                                                                                Wirfs-Brock
          Jacobson
       Object-Oriented                                                          Responsibilities
     Software Engineering
                                                                 Odell
                                 Shlaer - Mellor
                                                             Classification
                                Object lifecycles


 dvduc-2004                            Phân tích thiết kế hướng đối tượng                          Bài 2 - 12/43
Khái quát về UML

   UML là ngôn ngữ để
        visualizing
        specifying
        constructing
        documenting
    các vật phẩm (artifacts) của hệ thống phần mềm
   Nó có thể sử dụng trong mọi tiến trình, xuyên suốt vòng
   đời phát triển và trải qua các công nghệ cài đặt khác
   nhau.




dvduc-2004              Phân tích thiết kế hướng đối tượng   Bài 2 - 13/43
Khái quát về UML

             Mô hình hóa các phần tử
             Các quan hệ
             Cơ chế mở rộng
             Các biểu đồ




dvduc-2004             Phân tích thiết kế hướng đối tượng   Bài 2 - 14/43
Mô hình hóa các phần tử

    Các phần tử cấu trúc
         class, interface, collaboration, use case, active class, component, node
    Các phần tử hành vi
         interaction, state machine
    Nhóm các phần tủ
         package, subsystem
    Các phần tử khác
         note




dvduc-2004                    Phân tích thiết kế hướng đối tượng         Bài 2 - 15/43
Các quan hệ

             Dependency
             Association
             Generalization
             Realization




dvduc-2004                Phân tích thiết kế hướng đối tượng   Bài 2 - 16/43
Cơ chế mở rộng

             Stereotype
             Tagged value
             Constraint




dvduc-2004              Phân tích thiết kế hướng đối tượng   Bài 2 - 17/43
Models and Diagrams

                                                      Class
                                                    Diagrams
                             Use Case
                                                                                 Object
                             Diagrams
             Sequence                                                           Diagrams
             Diagrams


   Scenario
     Scenario
   Diagrams                                                                     Component
    Collaboration
    Diagrams
                                                                                 Diagrams
      Diagrams
                                       Models

             Scenario
               Scenario
             Diagrams                                              Deployment
                Statechart
              Diagrams                                              Diagrams
                Diagrams               Activity
                                      Diagrams


dvduc-2004                    Phân tích thiết kế hướng đối tượng                    Bài 2 - 18/43
Diagrams

   A diagram is a view into a model
        Presented from the aspect of a particular stakeholder
        Provides a partial representation of the system
        Is semantically consistent with other views
   In the UML, there are nine standard diagrams
        Static views: use case, class, object, component, deployment
        Dynamic views: sequence, collaboration, statechart, activity




dvduc-2004                 Phân tích thiết kế hướng đối tượng   Bài 2 - 19/43
Workflows and Models
                                            UML diagrams provide
                                            views into each model
Requirements     Use Case
                  Model


                            Analysis
  Analysis
                             Model


                                            Design
  Design                                                     Depl.
                                            Model            Model


                                                                     Impl.
Implementation
                                                                     Model



                                                                                  Test
    Test                                                                         Model
                 Each workflow is associated with
                 one or more models.

 dvduc-2004                 Phân tích thiết kế hướng đối tượng               Bài 2 - 20/43
Representing System Architecture


                        Logical View                 Implementation View

        End-user                                                              Programmers
        Functionality                                                      Software management
                                   Use Case View


             Process View                                       Deployment View
       System integrators                                              System engineering
       Performance                                                             System topology
       Scalability                                                          Delivery, installation
       Throughput                                                               Communication


                     Conceptual                                        Physical


dvduc-2004                        Phân tích thiết kế hướng đối tượng                             Bài 2 - 21/43
Cần bao nhiêu khung nhìn?

      Mô hình phù hợp với ngữ cảnh phát triển hệ thống
      Không phải tất cả các mô hình đòi hỏi đầy đủ khung nhìn
             Đơn xử lý: Bỏ qua khung nhìn triển khai
             Đơn tiến trình: Bỏ qua khung nhìn tiến trình
             Chương trình rất nhỏ: Bỏ qua khung nhìn cài đặt
       Bổ sung các khung nhìn
             Data view
             Security view




dvduc-2004                     Phân tích thiết kế hướng đối tượng   Bài 2 - 22/43
UML Concepts

   UML được sử dụng để:
        Hiển thị biên hệ thống và các chức năng chính của nó bằng use
        cases và actors
        Mô tả hiện thực use case bằng interaction diagrams
        Biểu diễn các cấu trúc tĩnh của hệ thống bằng class diagrams
        Mô hình hóa hành vi đối tượng bằng state transition diagrams
        Biểu thị kiến trúc cài đặt vật lý bằng component & deployment
        diagrams
        Mở rộng các chức năng bằng stereotypes




dvduc-2004                 Phân tích thiết kế hướng đối tượng   Bài 2 - 23/43
Thí dụ ứng dụng UML

   Một trường đại học thực hiện tin học hóa hệ thống đăng
   ký học và dạy học:
        Giáo vụ (Registrar) lập chương trình giảng dạy (curriculum) cho
        một học kỳ
        Sinh viên (Student) chọn 4 môn học chính và 2 môn dự bị
        Khi sinh viên đăng ký học thì hệ thống thanh toán (billing system)
        in hóa đơn học phí cho sinh viên
        Sinh viên có thể sử dụng hệ thống để bổ sung/loại bỏ môn học sau
        khi đã đăng ký (trong khoảng thời gian cố định)
        Giáo sư (Professors) sử dụng hệ thống để xem bảng phân công
        dạy học (course rosters)
        Người sử dụng hệ thống đăng ký được cấp passwords để vào máy



dvduc-2004                 Phân tích thiết kế hướng đối tượng   Bài 2 - 24/43
Use case Diagram


                                                 Request Course Roster
         Student                                                               Professor

                        Maintain Schedule




       Billing System
                                                                    Maintain Curriculum

                                              Registrar




dvduc-2004                     Phân tích thiết kế hướng đối tượng                Bài 2 - 25/43
Use case Diagram

       Use case diagrams are created to visualize the
       relationships between actors and use cases
       Captures system functionality as seen by users
       Built in early stages of development
       Purpose
             Specify the context of a system
             Capture the requirements of a system
             Validate a system’s architecture
             Drive implementation and generate test cases
       Developed by analysts and domain experts



dvduc-2004                   Phân tích thiết kế hướng đối tượng   Bài 2 - 26/43
Sequence Diagram

                                registration          registration              math 101              math 101
       : Student
                                   form                manager                                        section 1

                   1: fill in info

                    2: submit

                                     3: add course(joe, math 01)

                                                              4: are you open?
                                                                                      5: are you open?
                                                                   6: add (joe)
                                                                                           7: add (joe)




dvduc-2004                                 Phân tích thiết kế hướng đối tượng                             Bài 2 - 27/43
Sequence Diagram

             A sequence diagram displays object interactions
             arranged in a time sequence
             Captures dynamic behavior (time-oriented)
             Purpose
               Model flow of control
               Illustrate typical scenarios




dvduc-2004                    Phân tích thiết kế hướng đối tượng   Bài 2 - 28/43
Collaboration Diagram

                                                                       course form :
                             1: set course info
                                                                        CourseForm
                                 2: process




                                                                                  3: add course
         : Registrar




                                                                    theManager :
                 aCourse :
                                                                 CurriculumManager
                  Course
                                   4: new course




dvduc-2004                        Phân tích thiết kế hướng đối tượng                      Bài 2 - 29/43
Collaboration Diagram

             A collaboration diagram displays object interactions
             organized around objects and their links to one
             another
             Captures dynamic behavior (message-oriented)
             Purpose
                Model flow of control
                Illustrate coordination of object structure and control




dvduc-2004                     Phân tích thiết kế hướng đối tượng     Bài 2 - 30/43
Class Diagram

                                                                                        ScheduleAlgorithm
     RegistrationForm

                            0..*
                                   1 RegistrationManager
                                    addStudent(Course, StudentInfo)
                                                                                                       Course
                                                                       1
                                                                                               name
                                                                                        0..*   numberCredits
                                           Student                                             open()
                                                                                               addStudent(StudentInfo)
                                          major

                                                                                                     1
                                                      3..10
                                                                                         1..*
             Professor
                                                                       4      CourseOffering
             tenureStatus
                                                                             location
                              1
                                                                      0..4   open()
                                                                             addStudent(StudentInfo)




dvduc-2004                           Phân tích thiết kế hướng đối tượng                                        Bài 2 - 31/43
Class Diagram

      A class diagram shows the existence of classes and their
      relationships in the logical view of a system
      Captures the vocabulary of a system
      Built and refined throughout development
      Purpose
             Name and model concepts in the system
             Specify collaborations
             Specify logical database schemas
      Developed by analysts, designers, and implementers




dvduc-2004                   Phân tích thiết kế hướng đối tượng   Bài 2 - 32/43
Object Diagram

             Shows instances and links
             Built during analysis and design
             Purpose
                Illustrate data/object structures
                Specify snapshots
             Developed by analysts, designers, and implementers




dvduc-2004                      Phân tích thiết kế hướng đối tượng   Bài 2 - 33/43
State Transition Diagram

                                                                                Add student [count < 10]
                                                      Add Student /
                                                      Set count = 0
              Initialization
                                                                                               Open
             do: Initialize course
                                                                                       entry: Register student
                                                                                        exit: Increment count

                              Cancel

                                                                 Cancel                       [count = 10]

                              Canceled
                     do: Notify registered students
                                                                                    Closed
                                                            Cancel            do: Finalize course




dvduc-2004                                     Phân tích thiết kế hướng đối tượng                                Bài 2 - 34/43
State Transition Diagram

             State transition diagrams are created for objects
             with significant dynamic behavior
             Captures dynamic behavior (event-oriented)
             Purpose
                Model object lifecycle
                Model reactive objects (user interfaces, devices, etc.)




dvduc-2004                    Phân tích thiết kế hướng đối tượng     Bài 2 - 35/43
Activity Diagram


  Captures dynamic
  behavior (activity-
  oriented)
  Purpose
       Model business
       workflows
       Model operations




dvduc-2004                Phân tích thiết kế hướng đối tượng   Bài 2 - 36/43
Component Diagram
                                                           Register.exe
               Billing.exe

                               Billing
                              System




                                                                          People.dll
                                                                                             User
                                Course.dll
                                                    Course




                                                                                       Professor
                                                              Student
             Course              Course
                                 Offering




dvduc-2004                          Phân tích thiết kế hướng đối tượng                       Bài 2 - 37/43
Component Diagram

        Component diagrams illustrate the organizations and
        dependencies among software components
        Captures the physical structure of the implementation
        Built as part of architectural specification
        Purpose
             Organize source code
             Construct an executable release
             Specify a physical database
        Developed by architects and programmers




dvduc-2004                   Phân tích thiết kế hướng đối tượng   Bài 2 - 38/43
Deployment Diagram

                         Registration                         Database




                                               Main
             Library                          Building


                         Dorm




dvduc-2004               Phân tích thiết kế hướng đối tượng              Bài 2 - 39/43
Deployment Diagram
                                        Dynamic HTML, JavaScript, Java
                       Client
                                        plug-ins, source code enhancements




                                                        Java, C, C++, JavaScript, CGI
                                       Server




                                                                       Java, C, C++, JavaBeans,
                                                    Application
                                                      Server           CORBA, DCOM




                                                                                          Native languages
         Fulfillment            Financial             Inventory             RDBMS
          System                 System                System               Server




dvduc-2004                             Phân tích thiết kế hướng đối tượng                    Bài 2 - 40/43
Deployment Diagram

             The deployment diagram shows the configuration of
             run-time processing elements and the software
             processes living on them
             Captures the topology of a system’s hardware
             Built as part of architectural specification
             Purpose
               Specify the distribution of components
               Identify performance bottlenecks
             Developed by architects, networking engineers, and
             system engineers



dvduc-2004                    Phân tích thiết kế hướng đối tượng   Bài 2 - 41/43
Rational Rose

   Rose is available in three editions:
        Rose Modeler – no language support
        Rose Professional – support for 1 language
        Rose Enterprise – supports multiple languages including (VC++,
        VB, Java, CORBA and XML)
   Why should we use Rational Rose?
        Common standard language--the Unified Modeling Language (UML)
        --results in improved team communication
        Reverse-engineering capabilities allow you to integrate with legacy
        OO systems
        Models and code remain synchronized through the development
        cycle
        ...
                                            Demo Rose

dvduc-2004                 Phân tích thiết kế hướng đối tượng   Bài 2 - 42/43
Tóm tắt

             Các vấn đề đã nghiên cứu
               Khái niệm mô hình, mô hình hóa trực quan
               Khái quát về Ngôn ngữ mô hình hóa thống nhất
               Thí dụ sử dụng các biểu đồ của UML




dvduc-2004                Phân tích thiết kế hướng đối tượng   Bài 2 - 43/43

More Related Content

Similar to Phan Tich he Thong Bang UML2

citigroup January 19, 2007 - Fourth Quarter Financial Supplement
citigroup January 19, 2007 - Fourth Quarter Financial Supplementcitigroup January 19, 2007 - Fourth Quarter Financial Supplement
citigroup January 19, 2007 - Fourth Quarter Financial SupplementQuarterlyEarningsReports
 
Yves caseau@md day2011
Yves caseau@md day2011Yves caseau@md day2011
Yves caseau@md day2011MDDAY11
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable Requirements
Intergen
 
Modular architecture today
Modular architecture todayModular architecture today
Modular architecture today
pragkirk
 
[Day 2] Center Presentation: ICIMOD (2/2)
[Day 2] Center Presentation: ICIMOD (2/2)[Day 2] Center Presentation: ICIMOD (2/2)
[Day 2] Center Presentation: ICIMOD (2/2)
csi2009
 
SAMPLE PROCESS - TEMPLATE
SAMPLE PROCESS - TEMPLATESAMPLE PROCESS - TEMPLATE
SAMPLE PROCESS - TEMPLATE
Arul Nambi
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimicsKalica Wadhwa
 
mimacom & Liferay Roadshow : Introduction to Liferay platform
mimacom & Liferay Roadshow : Introduction to Liferay platformmimacom & Liferay Roadshow : Introduction to Liferay platform
mimacom & Liferay Roadshow : Introduction to Liferay platform
Ján Gregor
 
[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process ModelsCarles Farré
 

Similar to Phan Tich he Thong Bang UML2 (10)

citigroup January 19, 2007 - Fourth Quarter Financial Supplement
citigroup January 19, 2007 - Fourth Quarter Financial Supplementcitigroup January 19, 2007 - Fourth Quarter Financial Supplement
citigroup January 19, 2007 - Fourth Quarter Financial Supplement
 
Ebay News 2006 7 19 Earnings
Ebay News 2006 7 19 EarningsEbay News 2006 7 19 Earnings
Ebay News 2006 7 19 Earnings
 
Yves caseau@md day2011
Yves caseau@md day2011Yves caseau@md day2011
Yves caseau@md day2011
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable Requirements
 
Modular architecture today
Modular architecture todayModular architecture today
Modular architecture today
 
[Day 2] Center Presentation: ICIMOD (2/2)
[Day 2] Center Presentation: ICIMOD (2/2)[Day 2] Center Presentation: ICIMOD (2/2)
[Day 2] Center Presentation: ICIMOD (2/2)
 
SAMPLE PROCESS - TEMPLATE
SAMPLE PROCESS - TEMPLATESAMPLE PROCESS - TEMPLATE
SAMPLE PROCESS - TEMPLATE
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
 
mimacom & Liferay Roadshow : Introduction to Liferay platform
mimacom & Liferay Roadshow : Introduction to Liferay platformmimacom & Liferay Roadshow : Introduction to Liferay platform
mimacom & Liferay Roadshow : Introduction to Liferay platform
 
[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

Phan Tich he Thong Bang UML2

  • 1. VIỆN KHOA HỌC VÀ CÔNG NGHỆ VIỆT NAM VIỆN CÔNG NGHỆ THÔNG TIN PHÂN TÍCH THIẾT KẾ HƯỚNG ĐỐI TƯỢNG PGS.TS. Đặng Văn Đức Email: dvduc@ioit.ncst.ac.vn
  • 2. NỘI DUNG 1. Tiến trình phát triển phần mềm theo hướng đối tượng Giới thiệu Ngôn ngữ mô hình hóa thống nhất UML 3. Mô hình hóa nghiệp vụ 4. Mô hình hóa trường hợp sử dụng 5. Mô hình hóa tương tác đối tượng 6. Biểu đồ lớp và gói 7. Biểu đồ chuyển trạng thái và biểu đồ hoạt động 8. Biểu đồ kiến trúc vật lý và phát sinh mã trình 9. Mô hình hóa dữ liệu 10. Bài học thực nghiệm dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 2/43
  • 3. Bài 2 Giới thiệu Ngôn ngữ mô hình hóa thống nhất
  • 4. Mô hình là gì? Mô hình là bức tranh hay mô tả vấn đề đang cố gắng giải quyết hay mô tả chính giải pháp vấn đề là ngôn ngữ của người thiết kế (trong nhiều lĩnh vực) là trình diễn hệ thống sẽ xây dựng là phương tiện giao tiếp giữa các stakeholders là kế hoạch chi tiết (blueprints) Mô hình cho khả năng suy diễn một số đặc tính của hệ thống thực Mô hình hóa trực quan Bằng các phần tử đồ họa Ngôn ngữ mô hình hóa là ngôn ngữ mô tả hệ thống hay tác nghiệp An abstraction is an intellectual simplification dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 4/43
  • 5. Thí dụ mô hình Mô hình: Quả địa cầu học sinh Thế giới thực Thế giới thực Làm chủ Đọc Sách Con người Ôtô Mô hình dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 5/43
  • 6. Thí dụ mô hình A model is a complete description of a system from a particular perspective dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 6/43
  • 7. Mô hình hóa trực quan? “Modeling captures essential Order parts of the system.” Dr. James Rumbaugh Item Ship via Business Process Visual Modeling is modeling using standard graphical Computer System notations dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 7/43
  • 8. Bốn nguyên tắc mô hình hóa Việc chọn mô hình nào để tạo lập có ảnh hưởng sâu sắc đến cách giải quyết vấn đề và cách hình thành các giải pháp Mỗi mô hình biểu diễn hệ thống với mức độ chính xác khác nhau Mô hình tốt nhất phải là mô hình phù hợp với thế giới thực Không mô hình nào là đầy đủ. Mỗi hệ thống thường được tiếp cận thông qua tập mô hình gần như độc lập nhau. dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 8/43
  • 9. Thiết kế kiến trúc The “why” The “what” System Architecture Satisfies Features Qualities S/W Architecture Requirements Constrain Architecture Representation System Quality Attributes Technology Produces Defines The “how” The “who” Follows Architect Process Skills Defines role Organization Stakeholders dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 9/43
  • 10. Ngôn ngữ mô hình hóa thống nhất UML 1.3 OMG Acceptance, Nov 1997 UML 1.1 Final submission to OMG, Sep ‘97 public First submission to OMG, Jan ´97 feedback UML 1.0 UML partners UML 0.9 June ´96 June 12, 2003 UML 2.0 Unified Method 0.8 OOPSLA ´95 Booch method OMT OOSE Other methods UML stands for Unified Modeling Language dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 10/43
  • 11. UML Partners Rational Software Corporation Hewlett-Packard I-Logix IBM ICON Computing Intellicorp MCI Systemhouse Microsoft ObjecTime Oracle Platinum Technology Taskon Texas Instruments/Sterling Software Unisys dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 11/43
  • 12. Contributions to the UML Harel Meyer Gamma, et al Statecharts Before and after Frameworks and patterns, conditions HP Fusion Operation descriptions and Booch message numbering Booch method Embley Rumbaugh Singleton classes and Object Modeling high-level view Technique Wirfs-Brock Jacobson Object-Oriented Responsibilities Software Engineering Odell Shlaer - Mellor Classification Object lifecycles dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 12/43
  • 13. Khái quát về UML UML là ngôn ngữ để visualizing specifying constructing documenting các vật phẩm (artifacts) của hệ thống phần mềm Nó có thể sử dụng trong mọi tiến trình, xuyên suốt vòng đời phát triển và trải qua các công nghệ cài đặt khác nhau. dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 13/43
  • 14. Khái quát về UML Mô hình hóa các phần tử Các quan hệ Cơ chế mở rộng Các biểu đồ dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 14/43
  • 15. Mô hình hóa các phần tử Các phần tử cấu trúc class, interface, collaboration, use case, active class, component, node Các phần tử hành vi interaction, state machine Nhóm các phần tủ package, subsystem Các phần tử khác note dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 15/43
  • 16. Các quan hệ Dependency Association Generalization Realization dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 16/43
  • 17. Cơ chế mở rộng Stereotype Tagged value Constraint dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 17/43
  • 18. Models and Diagrams Class Diagrams Use Case Object Diagrams Sequence Diagrams Diagrams Scenario Scenario Diagrams Component Collaboration Diagrams Diagrams Diagrams Models Scenario Scenario Diagrams Deployment Statechart Diagrams Diagrams Diagrams Activity Diagrams dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 18/43
  • 19. Diagrams A diagram is a view into a model Presented from the aspect of a particular stakeholder Provides a partial representation of the system Is semantically consistent with other views In the UML, there are nine standard diagrams Static views: use case, class, object, component, deployment Dynamic views: sequence, collaboration, statechart, activity dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 19/43
  • 20. Workflows and Models UML diagrams provide views into each model Requirements Use Case Model Analysis Analysis Model Design Design Depl. Model Model Impl. Implementation Model Test Test Model Each workflow is associated with one or more models. dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 20/43
  • 21. Representing System Architecture Logical View Implementation View End-user Programmers Functionality Software management Use Case View Process View Deployment View System integrators System engineering Performance System topology Scalability Delivery, installation Throughput Communication Conceptual Physical dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 21/43
  • 22. Cần bao nhiêu khung nhìn? Mô hình phù hợp với ngữ cảnh phát triển hệ thống Không phải tất cả các mô hình đòi hỏi đầy đủ khung nhìn Đơn xử lý: Bỏ qua khung nhìn triển khai Đơn tiến trình: Bỏ qua khung nhìn tiến trình Chương trình rất nhỏ: Bỏ qua khung nhìn cài đặt Bổ sung các khung nhìn Data view Security view dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 22/43
  • 23. UML Concepts UML được sử dụng để: Hiển thị biên hệ thống và các chức năng chính của nó bằng use cases và actors Mô tả hiện thực use case bằng interaction diagrams Biểu diễn các cấu trúc tĩnh của hệ thống bằng class diagrams Mô hình hóa hành vi đối tượng bằng state transition diagrams Biểu thị kiến trúc cài đặt vật lý bằng component & deployment diagrams Mở rộng các chức năng bằng stereotypes dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 23/43
  • 24. Thí dụ ứng dụng UML Một trường đại học thực hiện tin học hóa hệ thống đăng ký học và dạy học: Giáo vụ (Registrar) lập chương trình giảng dạy (curriculum) cho một học kỳ Sinh viên (Student) chọn 4 môn học chính và 2 môn dự bị Khi sinh viên đăng ký học thì hệ thống thanh toán (billing system) in hóa đơn học phí cho sinh viên Sinh viên có thể sử dụng hệ thống để bổ sung/loại bỏ môn học sau khi đã đăng ký (trong khoảng thời gian cố định) Giáo sư (Professors) sử dụng hệ thống để xem bảng phân công dạy học (course rosters) Người sử dụng hệ thống đăng ký được cấp passwords để vào máy dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 24/43
  • 25. Use case Diagram Request Course Roster Student Professor Maintain Schedule Billing System Maintain Curriculum Registrar dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 25/43
  • 26. Use case Diagram Use case diagrams are created to visualize the relationships between actors and use cases Captures system functionality as seen by users Built in early stages of development Purpose Specify the context of a system Capture the requirements of a system Validate a system’s architecture Drive implementation and generate test cases Developed by analysts and domain experts dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 26/43
  • 27. Sequence Diagram registration registration math 101 math 101 : Student form manager section 1 1: fill in info 2: submit 3: add course(joe, math 01) 4: are you open? 5: are you open? 6: add (joe) 7: add (joe) dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 27/43
  • 28. Sequence Diagram A sequence diagram displays object interactions arranged in a time sequence Captures dynamic behavior (time-oriented) Purpose Model flow of control Illustrate typical scenarios dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 28/43
  • 29. Collaboration Diagram course form : 1: set course info CourseForm 2: process 3: add course : Registrar theManager : aCourse : CurriculumManager Course 4: new course dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 29/43
  • 30. Collaboration Diagram A collaboration diagram displays object interactions organized around objects and their links to one another Captures dynamic behavior (message-oriented) Purpose Model flow of control Illustrate coordination of object structure and control dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 30/43
  • 31. Class Diagram ScheduleAlgorithm RegistrationForm 0..* 1 RegistrationManager addStudent(Course, StudentInfo) Course 1 name 0..* numberCredits Student open() addStudent(StudentInfo) major 1 3..10 1..* Professor 4 CourseOffering tenureStatus location 1 0..4 open() addStudent(StudentInfo) dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 31/43
  • 32. Class Diagram A class diagram shows the existence of classes and their relationships in the logical view of a system Captures the vocabulary of a system Built and refined throughout development Purpose Name and model concepts in the system Specify collaborations Specify logical database schemas Developed by analysts, designers, and implementers dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 32/43
  • 33. Object Diagram Shows instances and links Built during analysis and design Purpose Illustrate data/object structures Specify snapshots Developed by analysts, designers, and implementers dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 33/43
  • 34. State Transition Diagram Add student [count < 10] Add Student / Set count = 0 Initialization Open do: Initialize course entry: Register student exit: Increment count Cancel Cancel [count = 10] Canceled do: Notify registered students Closed Cancel do: Finalize course dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 34/43
  • 35. State Transition Diagram State transition diagrams are created for objects with significant dynamic behavior Captures dynamic behavior (event-oriented) Purpose Model object lifecycle Model reactive objects (user interfaces, devices, etc.) dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 35/43
  • 36. Activity Diagram Captures dynamic behavior (activity- oriented) Purpose Model business workflows Model operations dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 36/43
  • 37. Component Diagram Register.exe Billing.exe Billing System People.dll User Course.dll Course Professor Student Course Course Offering dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 37/43
  • 38. Component Diagram Component diagrams illustrate the organizations and dependencies among software components Captures the physical structure of the implementation Built as part of architectural specification Purpose Organize source code Construct an executable release Specify a physical database Developed by architects and programmers dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 38/43
  • 39. Deployment Diagram Registration Database Main Library Building Dorm dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 39/43
  • 40. Deployment Diagram Dynamic HTML, JavaScript, Java Client plug-ins, source code enhancements Java, C, C++, JavaScript, CGI Server Java, C, C++, JavaBeans, Application Server CORBA, DCOM Native languages Fulfillment Financial Inventory RDBMS System System System Server dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 40/43
  • 41. Deployment Diagram The deployment diagram shows the configuration of run-time processing elements and the software processes living on them Captures the topology of a system’s hardware Built as part of architectural specification Purpose Specify the distribution of components Identify performance bottlenecks Developed by architects, networking engineers, and system engineers dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 41/43
  • 42. Rational Rose Rose is available in three editions: Rose Modeler – no language support Rose Professional – support for 1 language Rose Enterprise – supports multiple languages including (VC++, VB, Java, CORBA and XML) Why should we use Rational Rose? Common standard language--the Unified Modeling Language (UML) --results in improved team communication Reverse-engineering capabilities allow you to integrate with legacy OO systems Models and code remain synchronized through the development cycle ... Demo Rose dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 42/43
  • 43. Tóm tắt Các vấn đề đã nghiên cứu Khái niệm mô hình, mô hình hóa trực quan Khái quát về Ngôn ngữ mô hình hóa thống nhất Thí dụ sử dụng các biểu đồ của UML dvduc-2004 Phân tích thiết kế hướng đối tượng Bài 2 - 43/43