310 likes | 411 Views
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?.
E N D
CS-432: Modern Software EngineeringWeek 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?
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
Key Terms Anthropomorphism – antropomorfismo Axiom – axioma Boundary class – clase en la periferia Instance – instancia Interface - interfaz
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
Inheritance Example • Note #id – protected (accessible in subclasses, but private to instantiated classes) Common characteristics are moved to parent (Section) Generalization Relations are used from child to parent (Classroom and Online) Describes isa type
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
Transitivity and Abstract Classes Class and Online objects are also a type of Model and inherit attributes and operations from Model
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
Abstract Operations Some classes cannot be implemented until we determine the subclass – paintSelf, eraseSelf
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
Sequence Diagram Revisited Branching (opt)
Sequence Diagram Revisited 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.
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.
Activity Diagram Process This section describes a five-step process used to create an activity diagram. 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. You must identify the activities, control flows, and object flows that occur between the activities. You should identify any decisions that are part of the process being modeled. You should attempt to identify any prospects for parallelism in the process. You should draw the activity diagram.
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.
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.
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.
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.
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.
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.
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.)
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
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