Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lecture Notes on UML and Configuration Management for Software Engineering - Prof. M. Rous, Study notes of Computer Science

Lecture notes on unified modeling language (uml) and configuration management for software engineering. The notes cover the history and importance of uml, modeling concepts, uml diagrams, and tools for configuration management. The document also discusses the benefits of using uml as a blueprint and a programming language.

Typology: Study notes

Pre 2010

Uploaded on 09/17/2009

koofers-user-y3i
koofers-user-y3i 🇺🇸

3.5

(2)

10 documents

1 / 44

Toggle sidebar

Related documents


Partial preview of the text

Download Lecture Notes on UML and Configuration Management for Software Engineering - Prof. M. Rous and more Study notes Computer Science in PDF only on Docsity! 1 INF 111 / CSE 121: Software Tools and Methods Lecture Notes for Summer Quarter 2008 Michele Rousseau Lecture Notes 7 - UML Announcements Quiz #3- Thursday – What will it cover? ● All readings assigned since the last quiz ● Plus the readings not covered on the last quiz: ● Through slide 54 in today’s lecture ◘Configuration Management ◘ Only through the first break! Readings on UML ● Another book on UML: Lecture Notes 7 - UML 2 ◘McLaughlin, Pollice & West (2006). Head First Object-Oriented Analysis & Design. O’Reilly, 2006. Assignments ● #1 has been graded ● Assignment #3 will be posted later this week 2 Last Lecture Quiz #2 Configuration Management Lecture Notes 7 - UML 3 Today’s Lecture Finish up ●Configuration Management ◘Version Control Modeling ●OOAD ◘UML • Class Diagrams Lecture Notes 7 - UML 4 • Use Case Diagrams • Sequence Diagrams 5 Delta-based versioning Lecture Notes 7 - UML 9 Moving on to OOAD Object Oriented Analysis & Design (OOAD) using… ●UML – Part ◘Overview ◘More details in discussion Lecture Notes 7 - UML 10 6 Brooks on Invisibility of Software “Software is invisible and unvisualizable. Geometric abstractions are powerful tools.” “As soon as we attempt to diagram software structure, we find it to tit t b t l l di t d h i dcons u e one, u severa genera rec e grap s, super mpose on upon another. The several graphs may represent the flow of control, the flow of data, patterns of dependency, time sequence, name-space relationships. These are usually not even planar, much less hierarchical. Indeed, one of the ways of establishing conceptual control over such structure is to enforce link cutting until one or more of the graphs becomes hierarchical.” Lecture Notes 7 - UML 11 What is UML? Unified Modeling Language (UML) Let’s break it down: Unified In 1994, ● Two important methodologists Rumbaugh and Booch decided to unify their approaches in 1994 In 1995, another methodologist, Jacobson, joined the team ● His work focused on use cases Lecture Notes 7 - UML 12 In 1997, ● the Object Management Group (OMG) started to standardize UML 7 Models Models are abstract representations Contain essential characteristics and omit non-essential details Models can be representations of the world ●Domain models ●Requirements Models can be representations of software Lecture Notes 7 - UML 13 ● Specifications ●Design ● Systems Why make models? Systems are complex and hard to understand ● The world, organizations, relationships, software Models can make certain aspects more clearly visible than in the real system What can you do with models? ● Express your ideas and communicate with other engineers ● Reason about the system ◘ detect errors Lecture Notes 7 - UML 14 ◘ predict qualities ● Generate parts of the real system ◘ Code ◘ Schemas Can reverse engineer a system to make a model 10 Remember: It’s only a model There will always be: Phenomena in the application domain that t i th d l ( b t ti )are no n e mo e a s rac on Details in the application that are not in the model (abstraction) ● Just what you need A model is never perfect Lecture Notes 7 - UML 19 ● “If the map and the terrain disagree, believe the terrain” Modeling Languages Natural language ● Extremely expressive and flexible ● Very poor at capturing the semantics of the model ● Better used for elicitation, and to annotate models for communication Semi-formal notation ● Captures structure and some semantics ● Can perform (some) automated reasoning, Lecture Notes 7 - UML 20 consistency checking, animation, etc. ● Mostly visual - for rapid communication with a variety of stakeholders Examples: diagrams, tables, structured English, etc. 11 Modeling Languages (2) Formal notation ● very precise semantics, extensive reasoning possible ● Can automate reasoning consistency checking , , completeness checking, simulation, etc.. ● Every detailed models ) Lecture Notes 7 - UML 21 Unified Modeling Language (UML) UML is a … ● semi-formal graphical (visual) modeling language ● Object Modeling Language (OMD) ● A way to communicate details… ◘ Code ◘ Architecture Uml is descriptive tries not to be prescriptive Lecture Notes 7 - UML 22 … essentially it is a set of diagrams used to model the system 12 3 Common Way to Use UML Sketch - Quick Communication Blueprint – Complete Specification Programming Language A bstraction Lecture Notes 7 - UML 23 UML as a Sketch Helps communicate some aspect of the system ● Forward & reverse engineering “Rough out” issues in the code Not all of the code – just parts that you are working on immediately ● Selective communication NOT complete specification Short discussion with a team Lecture Notes 7 - UML 24 ● (10 min – 1 day) Quick and Collaborative Informal 15 UML & the S/W Process(Requirements) ●State Diagram ◘Shows states and events that change the state • Can be useful with interesting life cycles Lecture Notes 7 - UML 29 Communication is key Customers may not be familiar with S/W techniques Break the rules is it enhances Communication UML & the S/W Process (Design) Class Diagrams ●From a software perspective ◘Show classes & how they interrelate Sequence Diagrams ●For Common Scenarios ◘Pick most significant scenarios from Use Cases ◘Use CRC cards or sequence diagrams Lecture Notes 7 - UML 30 to determine how the software should behave • Class, Responsibilities, Collaborators (CRC) cards are index cards used to represent » the responsibilities of classes » interaction between the classes 16 UML & the S/W Process (Design) Package Diagrams ●Show large-scale organization of the system State Diagrams ●Used for classes with complex lifecycles Deployment Diagrams Lecture Notes 7 - UML 31 ●Show the physical layout of the software All of these can be used for design Class Diagrams “A Class Diagram describes the types of objects in the system and the various ki d f t ti l ti hi th t i tn s o s a c re a ons ps a ex s among them” Class Name Attributes Makes it easier to see the big picture Lecture Notes 7 - UML 32 (Name:type) Operations (Name: Parameters) – Know what a class does at a glance 17 Attributes and Operations Attributes ●Describes a property as a line of text within the class box ● Attribute name corresponds to the name of a field in a programming language ● Visibility Marker ◘Denotes whether an attribute is… • Public (+) or Private (-) O ti Lecture Notes 7 - UML 33 pera ons ● Actions that a class knows to carry out ●Corresponds to methods on a class Attributes and Operations (2) Operation & Method are not the same thing An Operation is the procedure declaration A Method is the body of a procedure Associations Lecture Notes 7 - UML 34 ●Describe the relationship between two classes 20 Properties Attributes & Associations Properties ● A structural feature of a class (fields in a class) ●Can be represented 2 ways: Attributes or Associations Lecture Notes 7 - UML 39 Attributes and Associations Different notations for the same thing Example: Properties as Attributes Simple Example Book + author: String + title: String + isbn: Number Lecture Notes 7 - UML 40 21 Properties as Associations String Book Number+author 1..5 1 +isbn 1 1 titl 1 1 Lecture Notes 7 - UML 41 String + e Attributes & Associations Same properties different notations When do you use which? ● Attributes for more simple properties (such as Booleans or Dates) ● Associations for more significant properties (such as Orders or Customers) Associations show more – such as Lecture Notes 7 - UML 42 multiplicities (covered in discussion) 22 Some Basic Concepts Generalization (AKA Inheritance) ● For all instances of a superclass… ◘The subclass inherits… • Attributes • Operations • Associations (we’ll talk about these later) ◘Whatever is true for the superclass is true for the subclass Lecture Notes 7 - UML 43 Inheritance lets you build classes based on other classes without having to duplicate or repeat code. Example of Generalization Public class Jet extends Airplane { private static final int MULTIPLIER =2; Jet extends from the Airplane class – that means it inherits all of l ’ b h Airplane is the superclass for Jet. Jet is the subclass public Jet () { super(); } public void setSpeed (int speed) { super.setSpeed(speed * MULTIPLIER) } public void () { Airp ane s e avior Jet can modify the behavior of the superclass’ methods it can also just call on them. Lecture Notes 7 - UML 44 super.setSpeed (getSpeed() *2); } } Note: getSpeed is not in here because Jet is not modifying it You can still call getSpeed on Jet 25 Class Diagrams Association There is an association between two classes if an instance of one class must know about the other in order to perform its work . ● A relationship between instances of the two classes. ● In a diagram, an association is represented by a link connecting two classes. ●may have a role name to clarify the nature of the association Lecture Notes 7 - UML 49 ● A navigability arrow on an association indicates which direction the association can be traversed or queried. ◘no navigability arrows are bi-directional. Class Diagrams (2) Aggregation ● An association in which one class belongs to a collection. ● In a diagram, an aggregation is represented with a diamond end pointing to the part containing the whole. ◘“is a part of” Generalization ● An inheritance link indicating one class is a superclass of the other Lecture Notes 7 - UML 50 ◘ “is a” or “is like a” ● A generalization is represented with a triangle pointing to the superclass. Class Diagrams provide a static model view of the system Describes the Structure 26 Class Diagrams Lecture Notes 7 - UML 51 Take a break! Get some Coffee Wakey-Wakey When we return… Modeling ●More on UML Lecture Notes 7 - UML 52 27 Moving on UML ●Use Case Diagrams ● Sequence Diagrams Lecture Notes 7 - UML 53 Types of UML Diagrams Structure . (6 types) Class diagrams Behavior . (4 types) Activity diagram Object diagram Package diagram Composite structure diagram Component diagram Use Case diagram State machine diagram Interaction diagrams ● Sequence diagram ● Communication diagram ● Interaction overview Lecture Notes 7 - UML 54 Deployment Diagram diagram ● Timing diagram If the appropriate diagram is not part of UML use it anyways 30 Use Case Diagram – Medical Clinic Lecture Notes 7 - UML 59 Expanding Use Cases A simple use case diagram can be expanded to display more information Use Cases can be developed iteratively and incrementally System boundaries ● separates the system from the external actors ● Represented as a rectangle Lecture Notes 7 - UML 60 Generalizations ● shows that one use case is simply a special kind of another ● Represented with an open triangle 31 Use Cases: Includes & Extends Includes ● A relationship in which one use case (the base use case) includes the functionality of another use case ● Promotes reuse ● Should be used when the inclusion case is common in two or more use cases Lecture Notes 7 - UML 61 Both use similar notation, but are very different. Represented with a dashed line and <<includes>> or <<extends>> Includes & Extends Extends: ● specifies that one use case (extension) extends the behavior of another use case (base). ● reveals details about a system or application that are typically hidden in a use case ● the extension use case is not meaningful on its own ● Describes behavior sequences that can change the base case ● Each behavior sequence can be inserted into the base use case at a different point, called an Lecture Notes 7 - UML 62 extension point ● When do you use it ◘ A part of a use case that is optional system behavior ◘ A subflow is executed only under certain conditions ◘ A set of behavior segments that may be inserted in a base use case 32 Lecture Notes 7 - UML 63 Use-Case Templates Extended format of a use-case Provides consistent documentation for each use-case Clarifies what you are describing Lecture Notes 7 - UML 64 Many templates ● You will be provided one for your homework 35 Sequence Diagram Example: Hotel Reservation Lecture Notes 7 - UML 69 Elevator Example: Sequence Diagram Lecture Notes 7 - UML 70 Sequence Diagram for Serving Elevator Button 36 Guards When a condition must be met before a message is sent Represented by brackets on the message line [guard] Lecture Notes 7 - UML 71 Frames Encloses a region of a sequence diagram Guard specifies condition ● Allows you to specify several interactions within a guard Can be divided into one or more fragments Keyword specifies the type of frame Keywords: ● opt -Optional fragment that executes if guard is true ● alt -Alternative fragment for mutual exclusive choice between two or more message sequences ◘ Eg. If then Else ● loop -Loop fragment while guard is true ● par Fragments that execute in parallel Lecture Notes 7 - UML 72 - ● region -Critical region within which only one thread can run 37 Frames/Combined Fragments Lecture Notes 7 - UML 73 Frame: Option Like a typical guard expanded Lecture Notes 7 - UML 74 40 Loop Example StoreFront Cart Inventory loop AddItem ReserveItem Checkout Lecture Notes 7 - UML 79 PlaceItemInOrder ProcessOrder ConfirmOrder What if you only have 1 msg to loop? Use the “*” symbol As long as the condition holds the message is sent Lecture Notes 7 - UML 80 41 Synchronous & Asynchronous Calls Synchronous ● Some methods must finish before another can start Asynchronous ● Some methods can continue executing while others run Lecture Notes 7 - UML 81 Putting them together Class Diagrams Scenarios Use Cases Sequence Diagrams H d th ll k t th Lecture Notes 7 - UML 82 ow o ey a wor oge er UML is iterative & Incremental 42 Elevator Example: Basic Class Diagram Lecture Notes 7 - UML 83 Elevator Example: Use Case Lecture Notes 7 - UML 84
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved