Software Practicum CS 2335
Popular in Course
Popular in ComputerScienence
This 0 page Class Notes was uploaded by Alayna Veum on Monday November 2, 2015. The Class Notes belongs to CS 2335 at Georgia Institute of Technology - Main Campus taught by Staff in Fall. Since its upload, it has received 19 views. For similar materials see /class/234159/cs-2335-georgia-institute-of-technology-main-campus in ComputerScienence at Georgia Institute of Technology - Main Campus.
Reviews for Software Practicum
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 11/02/15
082335 UML Reference Table of Contents Introduction 4 Use Case Diaorams Basic Description 5 Basic C r 5 Actor 5 Relation hip 5 Use ase 6 Relationships Use Case 7 to 7 Use Case 6 System RoY 7 System Name 2 Fyample 2 Class Diagrams 1 1 Basic Description 1 1 Basic C r l 1 lass 1 1 Class Name 1 1 Stereotypes if applicable 1 1 Attributes Global Variables 12 pvamplec 12 Operations Methods 13 pvamplec 13 A 39 quot lasses 1 FYample 14 39 quot 39 391 14 Multiplicity l 4 V H 14 Basic Relationship Types 15 A neiatinn 1 5 C r 15 Implementation of an Interface 16 quot quot 16 Fyample 17 Additional Notes39 1 8 1 Diagrams 19 Basic Description 19 Basic C r 19 Actor l9 Object 19 Lifeline 19 Activation Rmz 70 Mes s2 09 7 1 Blocking Message 7 NonBlocking A 39 Message 77 Self quot 77 Return Messnoe 739 Creation Messnoe 7 Destruction Messnoe 7 Guard nnditinnc 74 Loops iteratiom 7 FYnmple 76 State Diagrams 77 Basic Description 77 Basic C r 77 Start Qtnte 77 End Qtnte 77 Qtnte 77 Internal Aotinnq 77 Transiti nn 7 R Guard 7 2 Event 7 R A cti nn 7 R FYnmple 79 Introduction The Uni ed Modeling Language UML is a language for specifying visualizing constructing and documenting the artifacts of software systems as well as for business modeling and other nonsoftware system The UML represents a collection of the best engineering practices that have been proven successful in the modeling of large and complex systems OMG Unified Modeling Language v15 March 2003 UML was developed for Rational Software by the following three individuals Ivar Jacobson Grady Booch and Jim Rumbaugh The idea behind UML began in 1994 and continues to progress today This document is meant to be a learning guide for the students of CS2335 Software Practicum at the Georgia Institute of Technology The document was created with OpenOfflce 112 All diagrams in this document were created with Microsoft Visio 2003 Professional Much of the inspiration and content for this document was derived from the OMG Unified Modeling Language specification for version 15 Released in March 2003 Authors Version 10 Ted Choc Initial Construction of the paper Use Case Diagrams Basic Description Use Case diagrams show how external actors will be accessinginteracting with your system Basic Components Actor Represented as a stick figure similar to the following 0 Actor Name An actor represents an external user of your system with a specified set of roles or use cases Relationships Actorto Actor Generalization 7 A generalization from actor A to actor B implies that actor A inherits the same use case associations as actor B ie actor A is able to interact with all use cases actor B is able to Actor B T Actor A Actorto Use Case Association 7 An association between an Actor and a use case implies that the actor is able to perform whatever action is specified in the use case Use Case A Actor A Use Case A use case represents a specific function of the system The function of any particular use case is usually representative of a sequence of messages between an Actor mentioned above and the system A use case is shown as an oval with the function performed written in the middle Use Case Function Relationships Use Case to Use Case lnclude 7 An include relationship from use case A to use case B implies that use case A also performs the action in use case B Use Case A Place Onilna Omar mildew I I Extend 7 An extend relationship from use case A to use case B implies that use case B is another function that can be performed in addition to use case A Please note there is a special notation required for this relationship shown below includes I Process Credit Cani Place Online Order Use Case A if EXTENSION POINTS Opuons after Placrng an order EXtensm Poms are I used to show exactly exldMSn how the use case is I W ds being extended All ext ding use cases I should map to an extension point Request Catalog r quot 39 7A quot quot quot fromusecaseAtousecaseB implies that use case A is a specialized form ofuse case B Place Order A Place Online Order Place Phone Order System Box Represents the system boundary which is represented as a solid rectangle shown below System Name Use Case A Actor A Use Case B Generally consxderedto be optional bum most cases R15 Very appropriate to have 1 e mum class Sstem Name box mentmned above Example mum to eBay Auction System U521 66 awe Seder Shows that buyers and sellers extendfmm abasm userthat has the a 111tytologmlogoutandregxster SG er Auction System memes semng End nme mung mma an mew 5mm H sme The above use case shows all of the sellers possible interactions wnh the place sytm s e nems The sellers are able to rate buyers mew men hxst and mo the aueuon system whxch can extherbe an aucuon or a t m purchase now e 9 The below use case dAagram shows the buyers possible interactions thh the system They mclude mewmg aueuo cmg bxds purchasing items rating sellers and mewmg than history 5 E Auction System Have ma meash m we Buyer Class Diagrams Basic Description Class diagrams represent the static structure of the application The diagram shows all the classes in your system the relationships between them and the content of the classes ie methods and global variables Basic Components Below are many of the necessary components used to create a class diagram but please be aware that the list below is NOT a complete listing of all components that can be used in class diagrams Class Used to represent an object that has a de ned structure with similar relationships and behaviors 1 L II 39 Classes are r of the g r Class Name The name ofthe object being modeled Stereotypes if applicable Some classes require more description than can be shown with just attributes and operations which is why stereotypes are used Stereotypes are placed above the class name in the top box ofthe class Some of the more common stereotypes are ltltabstractgtgt Means that the class can not be instantiated directly To represent a class as abstract you can also italicize the class name if you are using a computer UML tool ltltsingletongtgt An design pattern that states that only one instance of the class will exist at anyone time ltltinterfacegtgt Contains only operations which contain no functionality not modeled in UML though No Attributes ltltutilitygtgt Contains no attributes but just a set of static operations Similar in concept to Java39s Math class Attributes Global Variables Not required if your class has no global variables The basic syntax for an attribute is as follows ltpublicitygt ltnamegt lttypegt initial value Everything but the initial value is required for every attribute The 39lt gt 39 were used only for separation and not required when actually listing the attributes Publicity 7 used to show the visibility or scope of the attribute The following are the most common publicities public private protected 7 package protected Name 7 the identifier string for the attribute Type 7 the datatype of the attribute Initial Value 7 used to note the initial value of a variable if it is known Other Adomments Static Variables 7 Shown by underlining the entire attribute Examples count int 5 A public integer named count with an initial value of 5 color javaawtColor A private Color which is a java implementation specific class with the name color type User A protected User which is an imaginary class that we assume has already been created with the name type In addition type is also a static attribute Operations Methods Not required if your class has no methods The basic syntax for an operation is as follows ltpublicitygt ltnamegt ltparametersgt ltreturn typegt The 39lt gt are used only for separation and not required when listing operations Publicity 7 Same as Attributes shown above N Name 7 The identi er string Parameters 7 A comma separated list of the input parameters for the function Each parameter has the following form lttypegt ltnamegt default value Type 7 the datatype of the variable Name 7 the parameters string identifier Initial value 7 NOT required Used to show the default value of the parameter Return type 7 The datatype of the object this operation is returning Other Adomments Static Methods 7 Similar to static attributes static methods are underlined Examples draw Graphics g Canvas c void A public method draw that takes two input parameters and returns nothing calculateAverageVector numbers int A private method calculateAverage that takes a Vector of numbers as input and returns an their average as an integer isRunningj bool A protected method isRunning that takes no input parameters and returns a boolean value Association Classes Used to show that a specific object is tied directly to a relationship between two other classes The example below shows the use of an assoelauon elass to represent the cheekoutquot L l ltbr rv ln o a n speclflc to ths relauonshrp between aUser and aBook whlch ls only rrnportant for ths speclflc relauonshrp justlfylng the use of an assoerauon elass Relationships Multiplicity Aterrn that desenbes the number of objects that eornrnunleate Wth eaeh other ofanother elass Class B and an rnstanee of Class B speaks wrth rnany rnstanees of Class A then you would say that the rnultrpherty ls manyrtormany whlch ls sh b l n e ofthe relatronshrp ass A r rnany rnst ees of Class lass B o ly s s wrth one rnstanee of Class then th uluplrerty ls consldered to be onerto m sease yo 1d 1 1 th of l nshlpcl s to ClassA an B l belowto better see the syntax ofrnulupherty In addluon rnultrplrerty ean be when deflnlng the rnultrpherues between elasses Navigabi39lity term that desenbes the dlrecnon of arelatronshrp Thls wlll be usedlf the eornrnunreatron between two elasses ls e duecnonal You show th5 by placlng an arrow on the end ofthe relatronshrp eloses to the objectthat ls duectly belowthrs you wlll see that ClassA duects ClassB whlch rneans that all the e rnunreatro ween these two elasses ls starteolrn Clas Therefore ClassB wlll neyer eall arnethoolrn ClassA or aeeess ayanable ete Basic Relationship Types Association Th ba l eonneetron between two elasses to represent some eornrnunreatro between the two 5 1n aolol sort of wn a a solldllne between two elass tron you shoulol always narne your assoeratrons to noufy the r aoler ofthelrlntendedfuncnon Here are several examples of assoeratrons owes asln wun Composition An assoeratron that lmp es that one object ls eornpnseol ofanother object or r ob e c posmon also lmplles t n eyen lf the mam object terrn n as a soholhne between am object though Show on e enol of 9 two classes wrth afllled the rn composmon A bo s eornposeol of organs and and bones granted you ean olonate your organs butlets not conslder that m thrs exam ple Implementation of an Interface Thls relahonshlp ls useol to show that one elass ls lmplemehuhg ah lhlehfaee There are two ways to show that a elass implements an interface but elther cholce lmplles the same meanmg H e ls an example that shows both ways ofhephesehuhg the lmplemen tatlon an interface As you eau tell one methodls useful for interfaces Lhaty u are ole hlhg and others are useful lfyou are lmplemehuhg an external interface that you dldnot Wnte javaloSenallzaMe Generalization Thls relahonshlp ls useol to show that one elass subrclasses another The notation of a su rclass ls Lhatltmhents all of the global atmbutes and operation from lts parent elass the elass Lhatltls subrclassmg Thls of course excludes all nal method dvanables m Java speclflcally Here ls an example of how to use thls relahonshlp Example mManagens a singleton class whmh means there Then you Wm notice that the Albu on y be one mstance of AlbumManager at any pomt m a smgle mmummnw sma elu Pawn mum 51mg mammwm mm oaddFagEthuw Pqu wmumcales mm m n W99 Magmng Dxclums39chlumDam nama 5m adammmmwm Mum Additional Notes Do NOT over use the composition relationship in class diagram This type of relationship should be reserved for special circumstances specifically when the lifeline of one object is very strongly tied to another 7 then when the object that is composed of subobjects dies so do all ofthe subobjects Do NOT try and model all of the Swing components that will be used in your UI in a class diagram Just list the major components and do not worry about the smaller things JLabels JButtons etc If all of your relationships are pointing to a single class then most likely that class is a god class so consider refactoring your design abstracting out functionality etc Sequence Diagrams Basic Description A between rnu1trp1e objects Basic Components Below are the basre eornponents thatyou wru use m a sequence dAagram Actor Usedto show an enterna1 aetorrnteraetrng wrth your system Often used as the mgger for a sequence Shown by a suek gure wrth the appropnate narne underneath rt User dw w VrVr V 7 Object Represents an objectclass m your statre model UMZL e1ass dAagram Shown as a box wrth alabel m the fouowrng format ltrnstanee narnegt ltpaekage narne erfapplreab1egt lte1ass narnegt All of thrs should also be underhned reaehrngAssrstant rs the e1ass andtedrs the rnstanee Lifeline Represents the enrstenee of an rnstanee of aparueular e1ass at a speer e urne A To denote the tennrnatron of an rnstanee you plaee alarge x at the bottom ofthe ellne Llfellnes ean splrt to show condlnonal logl Represented as a dash llne extendlng from an Object or Aetor Belo e seve arnples of dlfferent llfellnes The rst example from lelt to nght shows the tennrnauon of allfellne on ls atypr llfellne whlch alsoeontarns e van nboxlnlnallze byamess geeall The 1139 ple shows how you ean spht atrrnelrne to show a condlnonal truefalse l smug lune mn l mnm Message rx M55 candlllanul Message gt2 ctivation Box Shows whlch objects eurrently has eontrol of the proeess ls warung for another to return To show a self eall on an object you plaee an addluonal Aetwatron Box on top of the ongln l Represented as a tlun box on top ofallfellne The box terrnrnates as soon as the object no longer has eontrol rnost llkely when the funeuon returns are also useful for thls seu Ca MMBBQ Message Messages are eans between objects m a sequence dAagram HVJIFORTANT The message should always be pomtmg to the object that eontams m message Example name then the sequence omose two methods wouldbe as follows ementsRxght Return Statement Sh gulFlblNamEtSlchInlName 1 ul ulNanmkslmvg mName memes e sewsth 1 gathalNamU Blocking Message retums Shown wnh a solxd arrowhead on a sohdlme Massage se Opbnns w nn am am yam users wUsevs0 NonBlockingAsynchronous Message Imphes that the system Wm continue wnh us operations nght after callmg the message Shown wnh a suck arrowhead on a sohdlme Meswg Emma nmssMEssageo gt SelfMessage A spem message that 5 used when an Object calls amethod on use Shown wnh either a sohd or suck arrowhead dependmg on the type of selfrcall blockmg solxd nonrblockmg suck on a sohdlme msiaga sum 2 tatw amSumU mm 1 1 x Return Message Usedto show the eomptetror ofamessage be usedto show retum statemerrts as well rtthe ongmal message was retummg some type ofvanable h m A t At A t wrth the User object above so the use otretum messages For the most part retum messages are not rreeessary but they can clanfy a complex dtagram Creation Masage Usedto show the ereataor of an object Same as the blockmgmessagebut themessage text rs ltltereategtgt The acnvatton h hm m V d box s Destruction Message Usedto show the termmataor ofan object Same as the blockmgmessagebut them ssagetextrs ltltdestroygtgt The destroy message pomts to the large so at the bottom of altfelme Guard Conditions Usedto show that some messages Wm only occur 1f some condmonal 15 true Shown by plaemg the followmg m front of the message lteondmona1 Message Below are some examples of how you can use guards 1 x gt 71 eunuemm 1 Loops iteration Usedto show that some messages or groups ofmessages wtu be exeeuted You ean show ttexatton for one message by addmg somethmg slmllarto aguard to the message ex for t 0 t lt 31mm createElemenm u show xteranon over agroup ofmessages by outlmmg those messages wtth dashedbox and plaemg the loop condmon at the bottom Here are examples of both types ofxterauon gm utsz nesNexwu M d eamen ms nexlm ewm ge1 2mrnWW adr 39qu nexemenn for u e u t e Wang M Example Below ls an example ofa relatively complex sequence of creating an album using the class diagram example from a ove ma ltltcrealegtgt WM lmel nulWyOMNhlMU State Diagrams Basic Description Basic Components Hete ate the basl eonnponents you wtll neeolto construct a state dlagram Start State Shows the entry potnt fot the state nnaehtne Shown as a soltol dot and an anow potnttng to the tntttal state H End State Shows the enttpotnt fot the state nnaehtne shown as a larger open dot wtth a small ftlled dot tnstde State e ts some condmon ofthe systenn but nnote speclflcally a condmon ofwhat ts eunently bemg dlagrammed The state eottlol s e whete an aetaont performed wattang on an event on some tntetaetaon that satasftes some condmon Shown as a tounoleolteetangle wtth the ame o the state tn the mlddle Ethane tntetnal aettons desenbeol below they ate dlsplayed tn a su eonnpattnnent below the name are any Internal Actions Sonnethtng thatts performedwhlle tn the eunent state Thete ate seyetal specl edtypes of aettons that ean be performed and they are denoted by plaetng the type and a slash pnor to the a hon The types are entry 7 performed when fttst entenng the state entt 7 performed when leavmg the state do 7 performed as long as tlne element remammg m tlne state lnclude e usedto speclfy tlnattlus state lnvokes a subrmachlne whlch wlll not be dlscussedln tlus paper Aetrons are not requlred Aetrons are placedln tlne lower subrcompmment oftlne state symbol Below ls an example of a slmple state wrtln no mtemal aeuons and anotlner that has a entry emt and do aetron Tran Transrtrons between states mustbe mggered by sometlung oeeurrrng whlch wlll ostlrkely be an event In adduon some transrtrons wlll only have guards but n mggers tlus guardto eventually beeome true or false posslbly m tlne do aetron menuoned aboye states same state The notauon for a transrtron ls as follows lteyentgt ltguard eonduongt1 ltacuongt Guard Sometlung tnatmust be sausfred before tlne transruon ean oeeur Event Sometlung rmportant tlnat oeeurs m tlne system whlch may or may not mgger a state transrtron Action Sometlung tnatrs performedby tlne system when maklng tlus transrtron
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'