Presentation is loading. Please wait.

Presentation is loading. Please wait.

SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.

Similar presentations


Presentation on theme: "SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin."— Presentation transcript:

1 SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin

2 Agenda – Lecture 4a Topics to be covered (though not in given order):
OO basics Casting. Design principles (GRASP) Cohesion & coupling. Design Models UML Sequence diagrams, … Quiz 1. 11/11/2018 SOEN 343, © P.Chalin,

3 OO Basics: Static vs. Dynamic Typing
Why not declare all fields or variables of reference types as Object void * (C++) What would we gain? What would we loose? 11/11/2018 SOEN 343, © P.Chalin,

4 Type Casting (in Statically Typed OO Languages)
Purpose of Casting Inform compiler of (assumed) subtype of an object. Compiler can then perform better type checking. Type cast Like an assertion, it may fail; e.g. Object i = new Integer(0); String s = (String) i; //  ClassCastException 11/11/2018 SOEN 343, © P.Chalin,

5 Design Principles Design for change
Subliminal message: (to be looked at next class) Design for change 11/11/2018 SOEN 343, © P.Chalin,

6 GRASP Information Expert (wk 3) Creator (wk 3) Low Coupling
General Responsibility Assignment Software Patterns. Information Expert (wk 3) Creator (wk 3) Low Coupling High Cohesion Controller Polymorphism (wk 2-3) 11/11/2018 SOEN 343, © P.Chalin,

7 Cohesion Measure of the degree of “relatedness” that elements within a module share. Degree to which the tasks performed by a single module are functionally related. Brain storm: Why put procedures/methods together within a module/class? 11/11/2018 SOEN 343, © P.Chalin,

8 Levels Of Cohesion 11/11/2018 SOEN 343, © P.Chalin,

9 Coupling Measures the degree of dependency that exists between modules. Brain storm: Give examples of code that creates coupling. 11/11/2018 SOEN 343, © P.Chalin,

10 Design Model: Sequence Diagrams
Participants: c : Customer, r : Rental, m : Movie Each participant has a life line (vertical dashed line) Synchronous message Return result Activation bar 11/11/2018 SOEN 343, © P.Chalin,


Download ppt "SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin."

Similar presentations


Ads by Google