370 likes | 441 Vues
IS223D: OBJECT-ORIENTED DESIGN. Lecture 1: UML Overview. Objectives. To introduce brief history of UML To introduce what is UML and its use To explain the elements of the UML To describe the UML architecture To enlighten UML tool options. Brief History. What is UML.
E N D
IS223D: OBJECT-ORIENTED DESIGN Lecture 1: UML Overview Information Systems Department
Objectives • To introduce brief history of UML • To introduce what is UML and its use • To explain the elements of the UML • To describe the UML architecture • To enlighten UML tool options Information Systems Department
Brief History Information Systems Department
What is UML • UML: Unified Modeling Language • The UML is a language for visualizing, specifying, constructing, and documentingthe software system Information Systems Department
What is UML • UML is made up of notation and diagrams • Notation consists of the elements that work together in a diagram, such as symbols, connectors, notes, values, codes or pseudo codes • Diagrams are pictorial representations of a process, the system or some part of it. • UML is defined as a set of specifications created and distributed by the Object Management Group (OMG). See www.omg.org for more information. Information Systems Department
What is UML • The UML is flexible • The UML is extensible • Can be interpreted based on your client specific need • The UML is scalable • You can use UML to model a large or small system. Information Systems Department
Use of UML Model business processes Capture system behavior Build a detailed specification of a system Show application structure Model data structure Generate programming code Describe system architecture Sketch out ideas Information Systems Department
UML Elements Information Systems Department
UML Elements: Things Information Systems Department
UML Elements: Relationships Association: A relationship that describes the connection of the elements to each other. Eg: A person owns a Porsche Generalization: A relationship between a general element and a more specific element. Eg: Porsche is a car. Aggregation: A relationship that indicates the whole-part connection. Eg: Wheel is part of Porsche 2 1 3 Information Systems Department
UML Elements: Diagrams • Communication Diagrams • Sequence Diagrams Information Systems Department
Use Case Diagrams UML Elements: Diagrams • Show what the system does from the perspective of actors that play various roles and interacting with the system. Insurance System Purchase Policy • Communication Diagrams • Sequence Diagrams Analyze Sales Statistics Customer Salesperson Analyze Customer Statistics Use-case diagram for an insurance business Information Systems Department
Class Diagrams UML Elements: Diagrams • Define classes and their static relationships • Class diagrams show the kind/type of object in the system and the association with each other name: String age: Integer Author name: String memory: Integer Computer Uses 1..* 0..1 Communication Diagrams Sequence Diagrams Class diagram showing classes Information Systems Department
Object Diagrams UML Elements: Diagrams name: “Dell P4” memory: 256 Bob’s Job PC: Computer • Object diagrams show system structure at the specific moment and time • Model instances of classes in various configurations name: “Bob J.” age: 32 Bob: Author name: “AMD K6” memory: 128 Bob’s Home PC: Computer Communication Diagrams Sequence Diagrams Information Systems Department Object diagram showing instances of the classes
Package Diagrams UML Elements: Diagrams Accounting Invoice HR • Package diagrams bundle elements together to create a higher view of the system • Shows the dependencies between different packages in a system. + Add Accounts + Remove Accounts + Get Employee Details + Adjust Accounting + Customer Invoice + Supplier Invoice Communication Diagrams Sequence Diagrams Information Systems Department
State Diagrams UML Elements: Diagrams On first floor Moving up Go up (floor) • State diagrams show a dynamic view of the system behavior Arrive at first floor Moving to first floor Arrive at floor Go up (floor) Moving down Arrive at floor Idle Communication Diagrams Sequence Diagrams Go down (floor) Time-out A behavioral state machine for an elevator Information Systems Department
Activity Diagrams UML Elements: Diagrams <Decisioninput> disk status Show MessageBox “Disk full” on screen (full) CustomerWindow. printAllCustomers() • Activity diagrams also show a dynamic view (behavior)of the system • Model workflow, business process (free space) Show MessageBox “Printing” on screen Communication Diagrams Remove MessageBox ^Printer.Print(file) Create PostScript file Sequence Diagrams An activity diagram for a printer server Information Systems Department
Interaction Diagrams UML Elements: Diagrams :Computer :Queue • Communication diagrams are another type of interaction diagram • Emphasis on link among of the objects 1: Print (file) [printer free] 1.1: Print (file) :PrinterServer :Printer Communication Diagrams Sequence Diagrams [printer busy] 1.2: Store (file) A communication diagram for a printer server Information Systems Department
Interaction Diagrams UML Elements: Diagrams :Computer :PrinterServer :Printer :Queue Print (file) Print (file) • Sequence diagrams is a type of interaction diagrams • Show how object communicate with the emphasis of time and the ordering of messages Print (file) alt [Printer free] [Printer busy] Store (file) Communication Diagrams Sequence Diagrams A sequence diagram for a print server Information Systems Department
Composite Structure Diagrams UML Elements: Diagrams Tire Storage • Composite structure diagrams show the run-time relationships, or connections between a set of instances by a classifier 1 10 Tire Bin: Storage Bin Packaged: Tire Loose: Tire Communication Diagrams Sequence Diagrams Information Systems Department
Component Diagrams UML Elements: Diagrams <component> :TitleDao <component> :TitleVo <component> :BaseDao • Component diagrams give a view of a system in term of the component • The modules that represent the system building block Communication Diagrams Sequence Diagrams Information Systems Department
Deployment Diagrams UML Elements: Diagrams :AnyClientNode • Deployment diagrams map software artifacts to hardware to show the system’s physical layout : LibraryAppServer() Communication Diagrams Sequence Diagrams :LibraryDbServer() <artifact> Borrower.jar <artifact> Librarian.jar <artifact> Common.jar A deployment diagram shows the physical architecture of a system Information Systems Department
UML Elements: Diagrams Communication Diagrams Sequence Diagrams Information Systems Department
Architecture • Architecture refers to the different perspectives from which a complex system can be viewed. • Views in UML : • A view is an abstraction consisting of a number of diagrams • Shows different aspects of the system. Information Systems Department
Views in UML Information Systems Department
Views in UML Shows the functionality of the system as perceived by the external actors Used by customers, designers, developers, and testers Represented by use-case diagrams, and sometimes supported with activity diagrams Information Systems Department
Views in UML Describes how the system’s functionality is designed inside the system Used by designers and developers Represented by class diagrams, object diagrams, state diagrams, interaction diagrams and activity diagrams Information Systems Department
Views in UML Describes the main modules and their dependencies Used by developers Represented by component diagrams, interaction diagrams, and deployment diagrams Information Systems Department
Views in UML Shows the division of the system into processes and processors Used by developers and integrators of the system Represented by state diagrams, interaction diagrams, activity diagrams, and deployment diagrams Information Systems Department
Views in UML Shows the physical deployment of the system, such as the computers and devices and how they connect to each other Used by developers, integrators, and testers Represented by deployment diagrams Information Systems Department
Tool Options • Microsoft Visio • Rational Rose • Rational XDE • ArgoUML Information Systems Department
References • “UML 2 Toolkit”, Hans-Erik Eriksson , Magnus Penker, Brian Lyons, and David Fado • “The Unified Modeling Language User Guide (2nd Edition) ", Grady Booch, James Rumbaugh, and Ivar Jacobson, Addison-Wesley Professional Information Systems Department