cs-432: modern software engineering week 4

Post on 30-Dec-2015

24 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

scis.regis.edu ● scis@regis.edu

CS-432: Modern Software Engineering

Week 4

Dr. Jesús BorregoLead Faculty, COSRegis University

1

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

2

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

Key Terms

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

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

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)

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

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

Model and inherit attributes and operations from Model

8

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

Abstract Operations

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

10

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

Sequence Diagram Revisited

12

Loops

Sequence Diagram Revisited

13

Branching(opt)

Sequence Diagram Revisited

14

Referencing(ref)

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

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

Activity Diagram - Elements

17

Activity Diagram – Elements (Cont’d)

18

19

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

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

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

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

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

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

Statechart Diagram Elements

26

Building a Statechart Diagram

27

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

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

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

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

top related