CS-432: Modern Software Engineering Week 4

31
scis.regis.edu [email protected] CS-432: Modern Software Engineering Week 4 Dr. Jesús Borrego Lead Faculty, COS Regis University 1

description

CS-432: Modern Software Engineering Week 4. Dr. Jesús Borrego Lead Faculty, COS Regis University. Class Outline. Review of Homework Key Terms Inheritance and Generalization Transitivity and Abstract Classes Sequence Diagrams Activity Diagrams Statecharts Midterm exam Questions?. - PowerPoint PPT Presentation

Transcript of CS-432: Modern Software Engineering Week 4

Page 1: CS-432: Modern Software Engineering Week 4

scis.regis.edu ● [email protected]

CS-432: Modern Software Engineering

Week 4

Dr. Jesús BorregoLead Faculty, COSRegis University

1

Page 2: CS-432: Modern Software Engineering Week 4

Class Outline•Review of Homework•Key Terms•Inheritance and Generalization•Transitivity and Abstract Classes•Sequence Diagrams•Activity Diagrams•Statecharts•Midterm exam•Questions?

2

Page 3: CS-432: Modern Software Engineering Week 4

Review of Homework

•All homework submitted has been graded• If you have not submitted some

assignments, please do so right away•Do not forget about next week’s homework•Let me know if you are having problems

with material in the course•Make sure you read the material assigned

before class and before attempting the homework

3

Page 4: CS-432: Modern Software Engineering Week 4

Key Terms

• Anthropomorphism – antropomorfismo• Axiom – axioma• Boundary class – clase en la periferia• Instance – instancia• Interface - interfaz

4

Page 5: CS-432: Modern Software Engineering Week 4

Inheritance & Generalization Relation

•Inheritance is the ability to define a new class by extending an existing class – attributes and operations of existing class are included in new class

5

Page 6: CS-432: Modern Software Engineering Week 4

Inheritance Example

6

•Common characteristics are moved to parent (Section)

•Generalization Relations are used from child to parent (Classroom and Online)

•Describes isa type•Note #id – protected (accessible in

subclasses, but private to instantiated classes)

Page 7: CS-432: Modern Software Engineering Week 4

Inheritance terms

•Superclass – the parent of a set of classes; attributes and operations are inherited by the subclasses

•Subclass or Derived class – derived from the parent superclass, inheriting attributes and operations

7

Page 8: CS-432: Modern Software Engineering Week 4

Transitivity and Abstract Classes•Class and Online objects are also a type of

Model and inherit attributes and operations from Model

8

Page 9: CS-432: Modern Software Engineering Week 4

Transitivity and Abstract Classes (Cont’d)•Abstract class – a class that is incomplete

and cannot be instantiated.•Denoted by using italics in the name•Model and Section are abstract•Classroom and Online are called concrete classes

9

Page 10: CS-432: Modern Software Engineering Week 4

Abstract Operations

•Some classes cannot be implemented until we determine the subclass – paintSelf, eraseSelf

10

Page 11: CS-432: Modern Software Engineering Week 4

Classifier and Instance

•Instance variables are variables that are created as part of the class (created when the class is instantiated)

•If we want to create variables that are not created every time the class is instantiated, we need to declare static variables

•A static variable is common to all class instantiations

11

Page 12: CS-432: Modern Software Engineering Week 4

Sequence Diagram Revisited

12

Loops

Page 13: CS-432: Modern Software Engineering Week 4

Sequence Diagram Revisited

13

Branching(opt)

Page 14: CS-432: Modern Software Engineering Week 4

Sequence Diagram Revisited

14

Referencing(ref)

Page 15: CS-432: Modern Software Engineering Week 4

Activity Diagram

•Activity diagrams are sometimes called “object-oriented flowcharts”.

•They allow you to model a process as a collection of activities and transitions between those activities.

•Activity diagrams are really just special cases of state diagrams where every state has an entry action that specifies some process or function that occurs when the state is entered.

15

Page 16: CS-432: Modern Software Engineering Week 4

Activity Diagram (Cont’d)

•Activity diagrams are used to document workflows in a system, from the business level down to the operational level.

•The general purpose of activity diagrams is to focus on flows driven by internal processing versus external events.

16

Page 17: CS-432: Modern Software Engineering Week 4

Activity Diagram - Elements

17

Page 18: CS-432: Modern Software Engineering Week 4

Activity Diagram – Elements (Cont’d)

18

Page 19: CS-432: Modern Software Engineering Week 4

19

Page 20: CS-432: Modern Software Engineering Week 4

Activity Diagram ProcessThis section describes a five-step process used to create an activity diagram.1.Since the activity diagram can be used to model any kind of process, you should first set the context or scope of the activity being modeled. Once you have determined the scope, you should give the diagram an appropriate title.2.You must identify the activities, control flows, and object flows that occur between the activities.3.You should identify any decisions that are part of the process being modeled.4.You should attempt to identify any prospects for parallelism in the process.5.You should draw the activity diagram.

20

Page 21: CS-432: Modern Software Engineering Week 4

Statechart diagram

•Statechart diagrams also model the dynamic behavior aspects of a system.

•Statechart diagrams tend to be used for modeling the lifecycle history of a single object in the system.

•Some objects are incredibly complicated, so complex that developers can have difficulty understanding them.

21

Page 22: CS-432: Modern Software Engineering Week 4

States

•The state of an object is defined by the value of its attributes and its relationships with other objects at a particular point in time.

•The attributes of an object affect the state it is in.

•The key to successful statechart modeling is to identify the states that make a difference to your system.

22

Page 23: CS-432: Modern Software Engineering Week 4

Events

•An event is something that takes place at a certain point in time and changes a value(s) that describes an object, which, in turn, changes the object’s state.

•It can be a designated condition becoming true, the receipt of the call for a method by an object, or the passage of a designated time period.

•The state of the object determines exactly what the response will be.

23

Page 24: CS-432: Modern Software Engineering Week 4

Transitions

•A transition is a relationship that represents the movement of an object from one state to another state.

•Some transitions will have a guard condition (represents the value of the test for that particular path to be executed)

•An object typically moves from one state to another based on the outcome of an action that is triggered by an event.

24

Page 25: CS-432: Modern Software Engineering Week 4

Actions and Activities

•An action is an atomic, non-decomposable process that cannot be interrupted.

•From a practical perspective, actions take zero time, and they are associated with a transition.

•In contrast, an activity is a decomposable process that can be interrupted.

•Activities take a long period of time to complete, they can be started or stopped by an action, and they are associated with states.

25

Page 26: CS-432: Modern Software Engineering Week 4

Statechart Diagram Elements

26

Page 27: CS-432: Modern Software Engineering Week 4

Building a Statechart Diagram

27

Page 28: CS-432: Modern Software Engineering Week 4

Polymorphism

•Is an important concept used in virtually every object-oriented design.

•Means many forms and concerns the ability of an object to dynamically take on a different form depending on the runtime context.

•Polymorphism involves the behavior of objects.

•This behavior is a direct result of the inherent design of a class.

28

Page 29: CS-432: Modern Software Engineering Week 4

Activity 1

•Develop a state diagram for the state of a video in the Blockbuster case study

•Consider when the video is ordered, purchased and entered in the store for check out.

•Work as a group

(30 min.)

29

Page 30: CS-432: Modern Software Engineering Week 4

Homework 4

•This week you will begin working on your design model, which will consist of class and sequence diagrams.

•The models in this assignment will be assessed using the DesignModelRubrics.doc expectations rubric.

•Submit to WorldClass before Week 5

30

Page 31: CS-432: Modern Software Engineering Week 4

Next Class

•Wednesday, February 5, 2014•Make sure you turn in any assignments

due by next class•We review the midterm exam next week,

so submit to WorldClass before week 5’s class

31