Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi 1-860-548-7880 Information Systems Spring 2011.

Similar presentations


Presentation on theme: "Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi 1-860-548-7880 Information Systems Spring 2011."— Presentation transcript:

1 Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi 1-860-548-7880 youneh@rpi.edu Information Systems Spring 2011

2 Lecture 10 ISM - © 2010 Houman Younessi Structural Modeling: Answers the question WHAT? We need to concentrate on static relationships between objects (SNAPSHOT). So, we need to depict: ObjectsClasses Links Associations Class Diagram

3 Lecture 10 ISM - © 2010 Houman Younessi CLASSES The implementation of a type A generator for instances A class is depicted as a solid-outlined rectangle with compartments: Must have a name compartment May have other compartments (up to 3 more)

4 Lecture 10 ISM - © 2010 Houman Younessi The other compartments may contain: Compartment 2: Attributes Compartment 3: Operations Compartment 4: Others (Business rules, exceptions, etc.) Name Compartment Attributes Compartment Operations Compartment Other Compartment Widget color: Color position:Coord=(0,0) move(from:Coord,to:Coord=(50,50)) get_color( ):Color draw( ) draw_all( ) color /= “white”

5 Lecture 10 ISM - © 2010 Houman Younessi Class name and the class name compartment: The name compartment must be present The name compartment contains the name of the class. Class names are centered, begin with a capital letter and are in boldface. Abstract class names are italicized.

6 Lecture 10 ISM - © 2010 Houman Younessi Attributes and the attribute compartment: May be omitted when drawing high level diagrams Are denoted as left justified plain lowercase text strings The name may be followed by a colon ( : ) followed by the type of the attribute Optionally we can set the initial value of the attribute. To do so, the type name is followed by ( = ) and then the value

7 Lecture 10 ISM - © 2010 Houman Younessi May contain a visibility tag. A visibility tag could be: +Public # Protected -Private

8 Lecture 10 ISM - © 2010 Houman Younessi Operations and the operations compartment: May be omitted when drawing high level diagrams Are denoted as left justified plain lowercase text strings. Abstract operations are italicized May have parentheses containing a comma separated list of the parameters of the method that implements the operation. Optionally the parameter list may have indicators. These are:

9 Lecture 10 ISM - © 2010 Houman Younessi inParameter is only passed in to the operation outParameter is only passed out (returned) inoutBoth (Default is “in”) May have a return list containing one or a comma separated list of more than one formal parameters following a colon after the parameter list. Multiple return parameters, if there, must have a name and a type separated by a colon.

10 Lecture 10 ISM - © 2010 Houman Younessi An operation may have a class scope. Class operations are underlined. May contain a visibility tag. A visibility tag could be: +Public # Protected -Private

11 Lecture 10 ISM - © 2010 Houman Younessi Attribute - color:Color=red Operation: # credit_rating(in candidate:Customer=current, in agency: Agent=dandb) : rating : Integer, reason : Text Usually we do not bother with this level of detail unless we aim to generate code automatically

12 Lecture 10 ISM - © 2010 Houman Younessi RELATIONSHIPS There are three basic types of relationship between classes. These are: Inheritance Aggregation Association

13 Lecture 10 ISM - © 2010 Houman Younessi INHERITANCE Parent Child 2Child 1 Discriminator …...

14 Lecture 10 ISM - © 2010 Houman Younessi Person FemaleMale gender Example:

15 Lecture 10 ISM - © 2010 Houman Younessi AGGREGATION Two types in UML: Weak aggregation Composition Brain Person Department Professor Composition Weak aggregation

16 Lecture 10 ISM - © 2010 Houman Younessi ASSOCIATIONS Association shows a named relationship between instances of a class and other instances of itself or between instances of two or more other classes. Class A Class B Role A:Class Role B:Class Name of Association Multiplicity

17 Lecture 10 ISM - © 2010 Houman Younessi Each association has two roles, each role is a direction on the association. These roles can be explicitly named on the association with a label. If not explicitly labeled, then the role name is the same as the target class and may be omitted. Order Person customer Is placed by

18 Lecture 10 ISM - © 2010 Houman Younessi ABABABAB 1 1..* 0..1 * An A is always associated with exactly one B An A is always associated with one or more B An A is always associated with zero or one B An A is always associated with zero or more B AB n An A is always associated with exactly n B n..m An A is always associated with n to m B Where n is any integer number greater than 1 Where n,m are integer numbers and m>n AB

19 Lecture 10 ISM - © 2010 Houman Younessi An association may have direction. When it does, the direction is shown with an arrow. AB In the above diagram, A, is called the source and B is the target. A bi-directional arrow indicates navigability in both directions. AB

20 Lecture 10 ISM - © 2010 Houman Younessi An association with a “many” side may be ordered. Ordering is shown as a label on the target class. Screen Window * {ordered} Visible on

21 Lecture 10 ISM - © 2010 Houman Younessi An association may be higher than binary. A Ternary Association Name Class A Class B Class C

22 Lecture 10 ISM - © 2010 Houman Younessi reservation Person Flight Seat Example:

23 Lecture 10 ISM - © 2010 Houman Younessi Employee sales rep 0..1* Corporate Customer Personal Customer Product contactName creditRating remind() bill(Real) creditCard# Customer name address rating():Integer 1 {if Order.customer.rating = 5 then Order.isPrepaid := True} * line item Order 1 * dateReceived: Date isPrepaid:Boolean number:String price:Money dispatch() close(Real) quantity:Integer price:Money isFilled: Boolean creditRating() >=4 Order Line

24 Lecture 10 ISM - © 2010 Houman Younessi Event State A relevant punctuation in time The arrival of a message A stimulus received by an object A relevant interval in time Response of an object to a message or event A response to a stimulus Events take no time States are held in time

25 Lecture 10 ISM - © 2010 Houman Younessi coin is inserted(amount) flight leaves(airline,number) mouse_button_clicked(button, location) item_select_mode cruising edit_mode Event State Events carry information from an object to another (a message), objects receive that information and may change state

26 Lecture 10 ISM - © 2010 Houman Younessi Event State Events can be thought of as a feature call on the target object. States can be thought of as an abstraction of the attribute values of the target object between two relevant events.

27 Lecture 10 ISM - © 2010 Houman Younessi SEQUENCE DIAGRAMS A sequence diagram captures the order of events and the direction of the messages passed. There are two forms of sequence diagrams: Simple sequence diagrams (Event Traces) Full sequence diagrams with concurrency

28 Lecture 10 ISM - © 2010 Houman Younessi caller:Person callee:Person Modem1:Modem modem2:Modema_line:Connection wake connect sound_dial_tone acknowledge accept_dial_ sequence ringing_tone disconnect dial_tone dial sound_ring_tone connect stop_ring_tone disconnect_signal break_connect stop_ring connect picked_ up ring_phone routed receive_call_ signal dial_tone phone_ringing connected sound_dial_tone

29 Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() [while caller not hang_up()] *[n]dial(n:Digit)5 Asynch. Event Synch. Event Activation Continuation Condition Iteration Condition Object life termination routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone()

30 Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone() caller:Person callee:Person wake acknowledge ringing_tone connected disconnect dial_tone phone_ringing connected dial_tone dial

31 Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone() wake acknowledge ringing_tone connected disconnect dial_tone Phone_ringing connected dial_tone caller callee dial

32 Lecture 10 ISM - © 2010 Houman Younessi COLLABORATION DIAGRAMS Collaboration diagrams also show the message exchange (collaboration) between several objects. They do so by depicting the message exchange between object icons through numbering the messages traveling between these objects.

33 Lecture 10 ISM - © 2010 Houman Younessi Modem:modem_2 Connection:aLine 1- connect() 3- *[n] dial(n:Digit) 10- disconnect_signal() 2- sound_dial_tone () 6a- ringing_tone() 8a- stops_ring_tone() 9a-connect( ) 11a- break_connection() 12a- sound_dial_tone 4- receive_call_signal() 6b- sound_ring_tone() 8b- stop_ringing() 9b- connect() 11b-break_connection() 12b- sound_dial_tone() 5- routed() 7-picked_up() Modem:modem_1 EXAMPLE COLLABORATION DIAGRAM

34 Lecture 10 ISM - © 2010 Houman Younessi STATE DIAGRAMS A state diagram relates events and states. State diagrams may be drawn from the perspective of the whole system as a single object, or from the perspective of any single object at any level of granularity. State diagrams may show concurrency or may be nested Usually it is best to draw the state diagram of only one object in the system at a time

35 Lecture 10 ISM - © 2010 Houman Younessi idle dial tone do/sound_dial_tone() connecting do/receive_call_signal () ringing do/sound_ring_tone ()do/ring_phone() connecte d disconnect_signal( ) picked_up() dial() routed() connect() disconnected reset() State Diagram of a modem communication line, normal case, successful connection. connected do/stop_ring_tone() do/stop_ring() do/connect() do/break_connection() do/sound_dial_tone()

36 Lecture 10 ISM - © 2010 Houman Younessi idle dial tone do/sound_dial_tone() connecting do/receive_call_signal() ringing do/sound_ring_tone ()do/ring_phone() connecte d disconnect_signal() picked_up() dial() routed() connect() disconnected reset() connected do/stop_ring_tone() do/stop_ring() do/connect() do/break_connection() do/sound_dial_tone() time-out do/ beep() time_out() busy tone do/ slow_tone() busy_num() fast busy tone do/fast_tone() busy_trunk() message do/play() message-done() invalid_num() reset() State Diagram of a modem communication line, with normal, and a number of non-normal cases.

37 Lecture 10 ISM - © 2010 Houman Younessi ringing do/sound_ring_tone ( ) idle connect do/connect ( ) acknowledge do/acknowledge ( ) dial do/dial( ) data ex. disconnecting do/disconnect_signal() wake() sound_dial_ tone() dial() stop ringing() connect( ) disconnect() break_connection() sound_ringing_tone() sound_dial_tone()

38 Lecture 10 ISM - © 2010 Houman Younessi Transformations This is the third modeling view. It answers the question “how”. Depending on level of granularity there are many techniques. Including: High Level: Activity Diagrams Low Level: Pseudocode Flowcharts etc. Not part of UML

39 Lecture 10 ISM - © 2010 Houman Younessi Activity diagrams depict the processing aspects of the system. They are similar to flowcharts except: ACTIVITY DIAGRAMS Activity charts allow synchronization They are similar to dataflow diagrams except: Communication between activities is via messages carrying data not the data itself Activity charts allow synchronization

40 Lecture 10 ISM - © 2010 Houman Younessi Order Processing Finance Stock Manager Receive Order Receive Supply Select Outstanding order item Assign Goods to Order Assign Item to Order Reorder Item Add Remainder to Stock Check Line Item Cancel Order Check order Authorize payment [failed] [succeeded] Dispatch Order [Stock assigned to all line items and payment authorized] *[for each line item on order] * [for each chosen order item] [in stock] [all outstanding order items filled] [notify supply] [out of stock]


Download ppt "Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi 1-860-548-7880 Information Systems Spring 2011."

Similar presentations


Ads by Google