Download presentation
Presentation is loading. Please wait.
Published byReynard Henry Modified over 9 years ago
1
UML 101 – An Introduction Julie Daniels Staff Software Engineering Specialist IBM Rational Software UML 101 – An Introduction Julie Daniels Staff Software Engineering Specialist IBM Rational Software
2
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 2......................... “26% of software projects succeed.” Standish Group, CHAOS Report, 2000 “26% of software projects succeed.” Standish Group, CHAOS Report, 2000 The Good News…
3
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 3......................... That means 74% failed! Standish Group, CHAOS Report, 2000 That means 74% failed! Standish Group, CHAOS Report, 2000 The Bad News…
4
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 4 How do we resolve these problems? Requirements Not Managed Ambiguous Communication Brittle Architectures Overwhelming Complexity Undetected Inconsistencies Insufficient Testing Uncontrolled Change Propagation
5
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 5 Use Component Architectures Industry Best Practices Address Problems Develop Iteratively Manage Requirements Continuously Verify Quality Control Change Best Practices Best Practices Model Visually
6
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 6 Use Component Architectures Implementing Industry Best Practices Model Visually Object Technology UML
7
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 7 Agenda Object Technology Introduction Four Principles Visual Modeling with UML Importance of Modeling Introducing UML Two Key Elements Eight Diagrams UML in Action UML Tool Marketplace IBM Rational XDE
8
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 8 What Is Object Technology? A set of principles (abstraction, encapsulation, modularity, hierarchy) guiding software construction, together with languages, databases, and other tools that support those principles. (Object Technology - A Manager’s Guide, Taylor, 1997.)
9
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 9 The Strengths of Object Technology Reflects a single paradigm Facilitates architectural and code reuse Reflects real world models more closely Encourages stability Is adaptive to change
10
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 10 Major object technology milestones Simula 1967 C ++ Late 1980s Smalltalk 1972 Java 1991 The UML 1996 ??? 2003+ The History of Object Technology
11
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 11 Where Is Object Technology Used? Client/Server Systems and Web Development Encapsulates business information in objects Real-time systems Software, like hardware, is built from components
12
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 12 Basic Principles of Object Technology Object Technology EncapsulationAbstraction Hierarchy Modularity
13
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 13 Principle 1: Abstraction StudentProfessor Course Offering (9:00 a.m., Monday-Wednesday-Friday) Course (e.g. Algebra)
14
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 14 Principle 2: Encapsulation Improves Resiliency Hides implementation from clients. Clients depend on interface.
15
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 15 Principle 2: Encapsulation with Polymorphism Manufacturer A Manufacturer B Manufacturer C OO Principle: Encapsulation The ability to hide many different implementations behind a single interface
16
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 16 Principle 3: Modularity Breaks up something complex into manageable pieces. Helps people understand complex systems.
17
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 17 Principle 4: Hierarchy Decreasing abstraction Increasing abstraction Asset RealEstate Savings BankAccount Checking Stock Security Bond Elements at the same level of the hierarchy should be at the same level of abstraction.
18
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 18 Where Are We? Object Technology Introduction Four Principles Visual Modeling with UML Importance of Modeling Introducing UML Two Key Elements Eight Diagrams UML in Action UML Tool Marketplace IBM Rational XDE
19
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 19 What Is a Model? A model is a simplification of reality. Why do we model?
20
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 20 Why Do We Model? Modeling achieves four aims: Visualize a system Specify the structure or behavior of a system Have a template to guide construction Document our decisions We build models of complex systems because we cannot comprehend such a system in its entirety.
21
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 21 The Importance of Modeling Paper Airplane Fighter Jet Less ImportantMore Important
22
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 22 Software Teams Often Do Not Model Many software teams build applications like building paper airplanes Start coding from project requirements Work longer hours and create more code Lack any planned architecture Doomed to failure Modeling is a common thread to successful projects.
23
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 23 No Single Model Is Sufficient Non-trivial systems best approached through a small set of nearly independent models. Create models that can be built and studied separately, but are still interrelated. Process ViewDeployment View Logical View Use-Case View Implementation View End-user Functionality Programmers Software management Performance scalability throughput System integrators System topology delivery, installation communication System engineering Analysts/Designers Structure Where have you seen many models of a single entity?
24
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 24 Where Are We? Object Technology Introduction Four Principles Visual Modeling with UML Importance of Modeling Introducing UML Two Key Elements Eight Diagrams UML in Action UML Tool Marketplace IBM Rational XDE
25
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 25 What Is the UML? A language for modeling object-oriented software Used for Visualizing Specifying Constructing Documenting
26
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 26 Visualizing, Specifying, Constructing, Documenting Forward Engineering (Code Generation) and Reverse Engineering Domain Expert User Interface Definition Use Case Diagram Actor A Use Case 1 Use Case 2 Use Case 3 Actor B Activity Diagram [yes] Actor A Actor B Class Diagram GrpFile read( ) open( ) create( ) fillFile( ) rep Repository name : char * = 0 readDoc( ) readFile( ) (from Persistence) FileMgr fetchDoc( ) sortByName( ) DocumentList add( ) delete( ) Document name : int docid : int numField : int get( ) open( ) close( ) read( ) sortFileList( ) create( ) fillDocument( ) fList 1 FileList add( ) delete( ) 1 File read( ) read() fill the code.. State Transition Diagram Openning Writing Reading Closing add file [ numberOffile==MAX ] / flag OFF add file close file Component Diagram Document Repository FileList FileManager GraphicFile File Collaboration Diagram user : »ç¿ëÀÚ mainWnd : MainWnd fileMgr : FileMgr repository : Repository document : Document gFile : GrpFile 9: sortByName ( ) L 1: Doc view request ( ) 2: fetchDoc( ) 5: readDoc ( ) 7: readFile ( ) 3: create ( ) 6: fillDocument ( ) 4: create ( ) 8: fillFile ( ) Sequence Diagram user mainWndfileMgr : FileMgr repositorydocument : Document gFile 1: Doc view request ( ) 2: fetchDoc( ) 3: create ( ) 4: create ( ) 5: readDoc ( ) 6: fillDocument ( ) 7: readFile ( ) 8: fillFile ( ) 9: sortByName ( ) ƯÁ¤¹®¼¿¡ ´ëÇÑ º¸±â¸¦ »ç¿ëÀÚ°¡ ¿äûÇÑ´Ù. ÈÀÏ°ü¸®ÀÚ´Â Àоî¿Â ¹®¼ÀÇ Á¤º¸¸¦ ÇØ´ç ¹®¼ °´Ã¼¿¡ ¼³Á¤À» ¿äûÇÑ´Ù. È¸é °´Ã¼´Â ÀоîµéÀÎ °´Ã¼µé¿¡ ´ëÇØ À̸§º°·Î Á¤·ÄÀ» ½ÃÄÑ È¸é¿¡ º¸¿©ÁØ´Ù. Model space Executable System Deployment Diagram Window95 ¹®¼°ü¸® Ŭ¶óÀ̾ðÆ®.EXE Windows NT ¹®¼°ü¸® ¿£Áø.EXE Windows NT Windows95 Solaris ÀÀ¿ë¼¹ö.EXE Alpha UNIX IBM Mainframe µ¥ÀÌŸº£À̽º¼¹ö Windows95 ¹®¼°ü¸® ¾ÖÇø´ ºÐ»ê ȯ°æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À¸·ÎÀÇ Á¤º¸ ½Ã½ºÅÛ ¿¬°á ¸ðµ¨ - À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ® - À©µµ¿ì NT: ÀÀ¿ë¼¹ö - À¯´Ð½º ¸Ó½Å: ÀÀ¿ë ¼¹ö ¹× µ¥ÀÌŸ ¼¹ö, Åë½Å ¼¹ö - IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌŸ ¼¹ö, Åë½Å ¼¹ö Forward Engineering (Code Generation) and Reverse Engineering Source Code edit, compile, debug, link 19
27
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 27 History of the UML
28
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 28 Inputs to the UML Fusion Operation descriptions, message numbering Fusion Operation descriptions, Meyer Before and after conditions Meyer Harel State charts Harel State charts Wirfs-Brock Responsibilities Wirfs-Brock Responsibilities Embley Singleton classes, high-level view Embley Singleton classes, -level view Odell Classification Odell Classification Shlaer-Mellor Object lifecycles Shlaer-Mellor Gamma, et.al Frameworks, patterns, notes Gamma, et.al Frameworks, patterns, notes Booch Rumbaugh Jacobson
29
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 29 Where Are We? Two key UML elements Object Class
30
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 30 Truck Chemical Process Linked List What Is an Object? An entity, either physical, conceptual, or software. Physical entity Conceptual entity Software entity Like a “part”
31
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 31 Representing Objects in the UML An object is represented as a rectangle with an underlined name. Named Object Anonymous Object Professor J Clark
32
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 32 What Is a Class? A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. A class is an abstraction of an object An object is an instance of a class A class is an abstraction in that it Emphasizes relevant characteristics Suppresses other characteristics
33
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 33 Representing Classes in the UML A class is represented using a rectangle with compartments. Professor J Clark
34
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 34 Where Are We? Object Technology Introduction Four Principles Visual Modeling with UML Importance of Modeling Introducing UML Two Key Elements Eight Diagrams UML in Action UML Tool Marketplace IBM Rational XDE
35
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 35 Seven UML Diagrams 1.Use-Case Diagram 2.Activity Diagram 3.Class Diagram 4.Sequence Diagram 5.Collaboration Diagram 6.Statechart 7.Deployment Diagram 8.Component Diagram
36
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 36 1 - UML Use-Case Diagram Models system requirements Shows interaction between the system and its environment Student View Report Card Register for Courses Login
37
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 37 UML Use-Case Diagram Course Catalog View Report Card Register for Courses Submit Grades Select Courses to Teach Student Professor Billing System Maintain Student Information Maintain Professor Information Login Close Registration Registrar
38
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 38 2 - UML Activity Diagram Activity State Synchronization Bar (Fork) Guard Condition Synchronization Bar (Join) Decision Concurrent threads Transition Select Course Check Schedule Check Pre-requisites Assign to course Resolve conflicts Update schedule [ student added to the course ] [ add course ] Delete Course [ delete course ] [ checks completed ] [ checks failed ] Supplements the use-case diagram
39
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 39 3 – UML Class Diagram Static view of a system RegisterForCoursesForm > CourseOffering > Schedule > 0..* 0..4 0..* 0..4 Student > 0..* 1 1 RegistrationController > 1111 0..1
40
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 40 UML Interaction Diagrams Models the dynamics of a system Shows messaging between objects Sequence Diagrams Collaboration Diagrams
41
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 41 4 - UML Sequence Diagram : Student : :RegisterForCoursesForm : :RegistrationController : Course Catalog : :CourseCatalogSystem 1: create schedule( ) 5: display course offerings( ) 2: get course offerings( ) 3: get course offerings(forSemester) 6: display blank schedule( ) 4: get course offerings( )
42
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 42 5 - UML Collaboration Diagram : Student : RegisterForCoursesForm : RegistrationController : CourseCatalogSystem 5: display course offerings( ) 6: display blank schedule( ) : Course Catalog 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(forSemester) 4: get course offerings( )
43
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 43 6 - UML Statechart Enrolled Freshman Sophmore Junior Senior H First year Second year Third year Fourth year Graduated [ credits >= 112 ] Applied [ rejected ] [ accepted ] H [ credits >= 28 ] [ credits >= 56 ] [ credits >= 84 ] Hiatus return leave Specifies the sequence of states that an object can take on.
44
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 44 7 - UML Deployment Diagram Desktop PC Registration Server Course Catalog > Billing System > Shows the configuration of processing nodes at run-time
45
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 45 8 - UML Component Diagram Billing System Course Registration System IBillingSystem Shows modular, deployable, and replaceable parts of a system Each component encapsulates implementation and exposes a set of interfaces.
46
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 46 Summary Using component architectures and visually modeling software help increase software development success rates Object technology is used to develop software using components Modeling is common thread to successful applications UML is used to visually model software The two key elements in UML are objects and classes No single model is sufficient for a non-trivial system UML provides eight diagrams that can be built and studied separately, yet are interrelated.
47
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 47 Where Are We? Object Technology Introduction Four Principles Visual Modeling with UML Importance of Modeling Introducing UML Two Key Elements Eight Diagrams UML in Action UML Tool Marketplace IBM Rational XDE
48
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 48 Main Players in UML Tool Marketplace .NET Players Borland (TogetherSoft) ControlCenter/JBuilder $5995 Microsoft Visio in Visual Studio Enterprise Architect edition $2500 Included with Visual Studio Enterprise Architect IBM Rational XDE.NET $1595 Modeler Edition, $2995 Developer Edition Java Players Borland (TogetherSoft) Control Center 5.5/JBuilder $5995 Embarcadero Describe $995/Developer Edition, $2995 Enterprise Edition IBM Rational XDE Java $1595 Modeler Edition, $2995 Developer Edition
49
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 49 Modeling for Business, Application and Data Modelers One notation: UML One tool: IBM Rational XDE Application Modeling Data Modeling Business Modeling
50
Fundamentals of Visual Modeling with UML Copyright © 2001 Rational Software, all rights reserved 50 Roundtrip Engineering in Rational XDE The Model Has Been Updated … … And The Code Has Been Updated … And Synchronize To Update The Code AND The Model
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.