SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin
Reminders Hand in your solutions to Exercise Set 1 (they will be returned). Homework is given in this lecture (see last slide). 4/7/2019 SOEN 343, © P.Chalin,
Agenda – Lecture 2a OO fundamentals continued. Design Delegation, polymorphism. Design “Levels” Methods UML flash: a language for expressing designs. Test Drive Development (TDD) and refactoring – a first demonstration – skipped, ran out of time due to room change delay. 4/7/2019 SOEN 343, © P.Chalin,
Java – some details to be read on your own. Primitive types: include Floating point : float, double. Integral : byte,short,int,long,char. boolean, is not assignment compatible with integral types; explicit conversion required. boolean b = (i == 0 ? false : true); Class types for “boxing”: Float, Double, Byte, … Boolean. E.g. Boolean o = new Boolean(b); 4/7/2019 SOEN 343, © P.Chalin,
java.util.Vector Vector class Example of use Implements a growable array of objects. Example of use String s = …; Vector v = new Vector(); v.add(s); // adds to end String t = v.elementAt(0); v.remove(s); int i = v.size(); List interface ArrayList class 4/7/2019 SOEN 343, © P.Chalin,
OO Fundamentals (Exercise Set 2) Answer Q1 and Q2 of Exercise Set 2 Delegation. Polymorphism. 4/7/2019 SOEN 343, © P.Chalin,
Design vs. Requirements and Implementation. Architectural Detailed 4/7/2019 SOEN 343, © P.Chalin,
Design Levels Architectural design Detailed design . Detailed design Implementation (executable designs) 4/7/2019 SOEN 343, © P.Chalin,
Two complimentary approaches to design Planned Design vs. Evolutionary Design Can we get away with only planned design? 4/7/2019 SOEN 343, © P.Chalin,
Evolutionary Design Practices Important characteristics XP Test driven development (TDD) Do not add code unless you have a test failing … Important characteristics “Full” automated test suites Refactoring Help us learn detailed design idioms, patterns, … 4/7/2019 SOEN 343, © P.Chalin,
Refactoring A refactoring is a change made to the internal structure of S/W to make it easier to understand and less expensive to modify, without changing its observable behavior. 4/7/2019 SOEN 343, © P.Chalin,
Can you pick out a good design? What is a good design? Satisfies user needs. Is a simple as possible. Kent Beck: Runs all tests Reveals intention. No duplication. Fewest number of classes or methods … can you smell bad design choices? 4/7/2019 SOEN 343, © P.Chalin,
“Bad Smells” Duplication. Long method. … we will be learning more. 4/7/2019 SOEN 343, © P.Chalin,
Further Reading Martin Fowler’s, “Is Design Dead”? martinfowler.com/articles/designDead.html 4/7/2019 SOEN 343, © P.Chalin,
UML Class Diagram – Class Parts named in class 4/7/2019 SOEN 343, © P.Chalin,
UML Class Diagram Generalization (inheritance) Dependency 4/7/2019 SOEN 343, © P.Chalin,
[Homework] Exercise Set 2 Complete the exercise set 2. 4/7/2019 SOEN 343, © P.Chalin,