Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts. Object-Oriented Design CRC Cards - UML class diagrams

Similar documents
No SVN checkout today. Object-Oriented Design

Designing Classes. Check out DesigningClasses project from SVN

CSSE 220 Day 19. Object-Oriented Design Files & Exceptions. Check out FilesAndExceptions from SVN

CSSE 220 Day 19. Object-Oriented Design Files & Exceptions. Check out FilesAndExceptions from SVN

Object-Oriented Design

Download FirstOODesignPractice from SVN. A Software Engineering Technique: (Class Diagrams)

Some Software Engineering Techniques (Class Diagrams and Pair Programming)

Chapter Goals. Chapter 7 Designing Classes. Discovering Classes Actors (end in -er, -or) objects do some kinds of work for you: Discovering Classes

Introduction to Extreme Programming

Activities Common to Software Projects. Software Life Cycle. Activities Common to Software Projects. Activities Common to Software Projects

CS487 Midterm Exam Summer 2005

5 Object Oriented Analysis

Chapter 8 Designing Classes. Big Java by Cay Horstmann Copyright 2009 by John Wiley & Sons. All rights reserved.

defined. defined. defined. defined. defined. defined. defined. defined. defined.

Objectives. Connecting with Computer Science 2

Introduction to Extreme Programming. Extreme Programming is... Benefits. References: William Wake, Capital One Steve Metsker, Capital One Kent Beck

Object-Oriented Software Engineering Practical Software Development using UML and Java

Test Driven Development TDD

XP Evolution Rachel Davies

COSC Week 3. J anuary 19, This week

Agile Model-Driven Development with UML 2.0 SCOTT W. AM BLER. Foreword by Randy Miller UNIFIED 1420 MODELING LANGUAGE. gile 1.

UML UNIFIED MODELLING LANGUAGE EXEMPLIFIED ON BLACKJACK. Object Oriented Programming (Samy Zafrany)

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

Chapter 9. Designing Classes. Chapter Goals. Chapter Goals. Choosing Classes. Choosing Classes. Self Test

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

SE 1: Software Requirements Specification and Analysis

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Systems Analysis and Design in a Changing World, Fourth Edition

Introduction to UML. Danang Wahyu utomo

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

Requirements and Design Overview

Chapter Goals. Chapter Eight: Designing Classes Contined. Choosing Classes

Designing Classes Advanced Programming ICOM 4015 Lecture 8 Reading: Java Concepts Chapter 8

The Object-Oriented Design Process

Notation Part 1. Object Orientated Analysis and Design. Benjamin Kenwright

Design and UML Class Diagrams

Software Development. Modular Design and Algorithm Analysis

UML Tutorial. Unified Modeling Language UML Tutorial

Designing applications. Main concepts to be covered

Object-Oriented Design and Modeling Using the UML

SE 2730 Final Review

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Software Engineering with Objects and Components Open Issues and Course Summary

CSE 70 Final Exam Fall 2009

Agile Development

Object Oriented Software Development CIS Today: Object Oriented Analysis

Object-Oriented Analysis and Design Using UML

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

Object-Oriented Systems Analysis and Design Using UML

Introduction to. and. Scott W. Ambler Source Documents

System Development Life Cycle Methods/Approaches/Models

CS 2340 Objects and Design

Topic 01. Software Engineering, Web Engineering, agile methodologies.

Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas

Final Exam CISC 475/675 Fall 2004

Processes, Methodologies and Tools. Fall 2005

E xtr B e y CS R m oy 6704, e T a P n a Spring r n o d J g ia n 2002 r g a S m hu m ing

Software Development Lifecycle Object Oriented Design using UML Design Review

Software Design and Analysis CSCI 2040

SRI VENKATESWARA COLLEGE OF ENGINERRING AND TECHNOLOGY THIRUPACHUR,THIRUVALLUR UNIT I OOAD PART A

Chapter 10 Object-Oriented Design Principles

MTAT Software Engineering. Written Exam 17 January Start: 9:15 End: 11:45

*ANSWERS * **********************************

KINGS COLLEGE OF ENGINEERING

What s Next. INF 117 Project in Software Engineering. Lecture Notes -Spring Quarter, Michele Rousseau Set 6 System Architecture, UML

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

CSC/ECE 517: Object-Oriented Languages and Systems Summer 2008 Test 2 with Answers

SOFTWARE LIFE-CYCLE PROCESSES From Waterfall to Extreme Programming

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

Lecture 7: Software Processes. Refresher: Software Always Evolves

Appendix A - Glossary(of OO software term s)

Introduction to Software Engineering: Analysis

How Can a Tester Cope With the Fast Paced Iterative/Incremental Process?

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

Outline of UML and Unified Process. Object Oriented Analysis/Design/Programming UML1.5. Koichiro Ochimizu, JAIST. UML&UP outline 1.

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay

Object Oriented Processes. R.K.Joshi Dept of Computer Science and Engg. IIT Bombay

1: Introduction to Object (1)

SE310 Analysis and Design of Software Systems

Lecture 34 SDLC Phases and UML Diagrams

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Chapter 1: Principles of Programming and Software Engineering

SOFTWARE LIFE-CYCLE MODELS 2.1

Introduction - SENG 330. Object-Oriented Analysis and Design

Incremental development A.Y. 2018/2019

SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY

Analysis and Design with UML

Patterns and Testing

CSSE 220 Day 13. Encapsulation Coupling and Cohesion Scoping. Please download EncapsulationExamples from your SVN

Design. Eric McCreath

MTAT Software Engineering. Written Exam 10 January Start: 9:15 End: 11:45

1: Software Development and.net. An approach to building software

Conceptual Data Modeling by David Haertzen

CS193D Handout 15 Winter 2005/2006 February 8, 2006 Software Engineering Methodologies and XP. See also: Chapter 6. The Stagewise Model

System Sequence Diagrams. Based on Craig Larman, Chapter 10 and Anuradha Dharani s notes

Object-Oriented Design

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Extreme programming XP 6

Foundations of object orientation

Transcription:

Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts Software methodologies Extreme Programming Object-Oriented Design CRC Cards - UML class diagrams

Analysis Design Implementation Software Development Testing Deployment Maintenance

Standardized approaches intended to: Reduce costs Increase predictability of results Examples: Examples: Waterfall model Spiral model Rational Unified Process

Analysis Do each stage to completion Then do the next stage Design Implementation Pipe dream model? Testing Deployment

Repeat phases in a cycle Produce a prototype at end of each cycle Get early feedback, incorporate changes Prototype Schedule overruns Scope creep Deployment

Like the spiral model with very short cycles Pioneered by Kent Beck One of several agile methodologies, focused on building high quality software quickly Rather than focus on rigid process, XP espouses 12 key practices

Realistic planning Small releases Shared metaphors Simplicity Testing Refactoring When you see opportunity to make code better, do it Pair programming Collective ownership Continuous integration 40-hour week On-site customer Coding standards Use descriptive names Q1

It starts with good classes

Often come from nouns in the problem description May Represent single concepts Circle, Investment Be abstractions of real-life entities BankAccount, TicTacToeBoard Be actors Scanner, CircleViewer Be utilities Math Q2

Can t tell what it does from its name PayCheckProgram Turning a single action into a class ComputePaycheck Name isn t a noun Interpolate, Spend Q3

Cohesion Coupling

A class should represent a single concept Public methods and constants should be cohesive Which is more cohesive? CashRegister double NICKEL_VALUE double DIME_VALUE double QUARTER_VALUE CashRegister void add(arraylist<coin> coins) void add(int nickels, int dimes, int quarters) Coin double getvalue() Q4

When one classes requires another class to do its job, the first class depends on the second Shown on UML diagrams as: dashed line with open arrowhead CashRegister void add(arraylist<coin> coins) Coin double getvalue() Q5

Lots of dependencies == high coupling Few dependencies == low coupling Which is better? Why? Q6

High cohesion Low coupling Immutable where practical, document where not Inheritance for code reuse Interfaces to allow others to interact with your code

A practical technique

We won t use full-scale, formal methodologies Those are in later SE courses We will practice a common object-oriented design technique using CRC Cards Like any design technique, the key to success is practice

1. Discover classes based on 1. requirements 2. Determine responsibilities of each class 3. Describe relationships between classes Q2

Brainstorm a list of possible classes Anything that might work No squashing Prompts: Tired of hearing this yet? Look for nouns Multiple objects are often created from each class so look for plural concepts Consider how much detail a concept requires: A lot? Probably a class Not much? Perhaps a primitive type Don t expect to find them all add as needed

Look for verbs in the requirements to identify responsibilities of your system Which class handles the responsibility? Can use CRC Cards to discover this: Classes Responsibilities Collaborators

Use one index card per class Class name Responsibilities Collaborators Q3

1. Pick a responsibility of the program 2. Pick a class to carry out that responsibility Add that responsibility to the class s card 3. Can that class carry out the responsibility by itself? Yes Return to step 1 No Decide which classes should help List them as collaborators on the first card Add additional responsibilities to the collaborators cards

Spread the cards out on a table Or sticky notes on a whiteboard instead of cards Use a token to keep your place A quarter or a magnet Focus on high-level responsibilities Some say < 3 per card Keep it informal Rewrite cards if they get to sloppy Tear up mistakes Shuffle cards around to keep friends together

NEW! Classes usually are related to their collaborators Draw a UML class diagram showing how Common relationships: Inheritance: only when subclass is a special case Aggregation: when one class has a field that references another class Dependency: like aggregation but transient, usually for method parameters, has a temporarily Association: any other relationship, can label the arrow, e.g., constructs

Q4