Design Joshua Lewis Project questions Assignment questions

Slides:



Advertisements
Similar presentations
Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation For C# Developers.
Advertisements

GRASP Patterns M Taimoor Khan
Planning, Outlining, Drafting e.g. Formally Starting the Process.
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
Copyright W. Howden1 Lecture 6: Design Evaluation and Intro to OO Design Patterns.
Week 8 Implementation Design Alex Baker. Implementation Design System Design – Describes what the system should do Implementation Design – Describes what.
CRC Card By: Yusmadi Yah Jusoh. What is CRC card?  A Class Responsibility Collaborator (CRC) model (Beck & Cunningham 1989; Wilkinson 1995; Ambler 1995)
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
1 Working with Classes Chapter 6. 2 Class definition A class is a collection of data and routines that share a well-defined responsibility or provide.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
Computer Science 240 Principles of Software Design.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
CSE 303 – Software Design and Architecture
ArchiMate Authors : eSchoolink Group - ITNLU. Contents 1. What’s ArchiMate ? 2. Why ArchiMate ? 3. Main Benefits of ArchiMate 4. Layers of ArchiMate 5.
1 On to Object Design Chapter 14 Applying UML and Patterns.
Introduction To System Analysis and Design
Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts Software methodologies – Extreme Programming Object-Oriented Design – CRC Cards - UML.
Extreme Programming (XP). Agile Software Development Paradigm Values individuals and interactions over processes and tools. Values working software over.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
GRASP: Designing Objects with Responsibilities
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
 Accessible informal format.  Graphical notation is trivial. But writing good use cases is a skillful process.
Chapter 17 – Object- Oriented Design. Chapter Goals To learn about the software life cycle To learn about the software life cycle To learn how to discover.
Object-Oriented Principles Applications to Programming.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
SWE 4743 Responsibility Driven Design with CRC cards Richard Gesick.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
+ Informatics 122 Software Design II Lecture 13 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Software Development Life Cycle. The Software Life Cycle  Encompasses all activities from initial analysis until end of work  Formal process for software.
CRC Cards: Overview Emerson Murphy-Hill Creative Commons Attribution 4.0 License. Material Produced by NCSU Software Engineering Faculty.
Chapter 5 Agile Development Moonzoo Kim KAIST
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Presented by FACADE PATTERN
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
GRASP – Designing Objects with Responsibilities
Software Requirements
Reviewing Code A guide to smelling another developer’s source code.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
May 17th – Comparison Sorts
Object-Oriented Analysis and Design
Chapter 16 Participating in Groups and Teams.
Matching Logic An Alternative to Hoare/Floyd Logic
Unified Modeling Language
Data Abstraction: The Walls
Summary of Bret Victor’s Paper
Advance Software Engineering
The Object-Oriented Thought Process Chapter 06
VENDORS, CONSULTANTS AND USERS
CSE 303 – Software Design and Architecture
Object-Oriented Design
Object-Oriented Analysis
Software Quality Engineering
Learning to Program in Python
Introduction To System Analysis and Design PART 2
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Why Object-oriented Programming?
Object oriented analysis and design
DESIGNING YOUR SYSTEM.
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Planning and Storyboarding a Web Site
OBJECT ARCHITECTURE DESIGN
Introduction to XP.
Tiffany Ong, Rushali Patel, Colin Dolese, Joseph Lim
Object/Class Design.
Functions, Procedures, and Abstraction
From Use Cases to Implementation
Presentation transcript:

Design Joshua Lewis Project questions Assignment questions Few small topics Might start SOLID if time

Design Q: What is design to you? Q: What are we doing when we say we’re ‘designing’? A - making decisions about trade-offs -deciding what goes where

Object-Oriented Design Q: What is Object-Orientation about fundamentally? - State/data opacity - Responsibilities and roles A system must fulfil responsibilities. 2 types of generic responsibilities – knowing and doing Various ways of allocating responsibilities in system OOD therefore about deciding how to allocate roles and responsibilities among objects Objects don’t work in isolation How do we go about allocating these roles and responsibilities? First technique is the use of CRC Cards

CRC Cards Use simple index cards to represent objects Card per object Card divided up into 3 sections, 1 each for Class, Responsibilities, and Collaborators Cards easy to move Emphasizes responsibilities, collaborators and dynamic relationship between classes Move collaborating classes together to show relationships Collaboratively brainstorm and design system of interacting objects Low-investment, lightweight, dynamic, interactive, collaborative Facilitates communication and shared understanding Developed by Ward Cunningham and Kent Beck as a teaching tool at OOPSLA 1989

CRC Cards and Conway’s Game of Life

General design considerations Q: Hardest thing about software development? A: Changing requirements Q: What’s the only guarantee when it comes to software systems? A: Change Q: So why are we so bad at it? - Software often lives longer than we initially expect Different challenges at different times – startup vs old corporate Approach should be different, deliberate and explicit

Software and change Q: Why so hard to change software? A: Hard part is understanding code well enough to know where and how code should change No unintended consequences Satisfies new requirements So hard part of s/w dev is understanding and being able to reason about code Anything we can do make it easier to understand and reason about is a GOOD THING Q: What makes it hard to understand and reason about code?

Obstacles Duplication ‘Clever’ code Complex flow Too many collaborators Nested conditionals Code with ambiguous intent Bad names Inconsistencies Code that does too much Re-inventing the wheel Coupling Discuss, give examples Coupling – knows too much about how collaborators work Clever code – optimised for performance or memory space Names – classes, methods, variables Why are these obstacles? Why do they cause problems? - Unintended consequences - cognitive load – we need to keep too much in our heads at a time This resource is limited and does get tired

Cognitive Load Q: How do we reduce cognitive load? Ie the number of things we need to maintain in our brains at a time? A: Abstraction and intention Intention: we want the intent of the code to be as clear and explicit as possible – structure, names, conditionals Q: Who are we writing code for? User Future developers (often ourselves) Quote: Write code as if you want future devs to want to buy you a beer after reading it Make it as easy as possible to read and understand

Abstraction Q: What is abstraction? Simplified representation Lacks detail (hides detail) Generalised Why powerful? Don’t need to know the whole picture – i.e. reduces cognitive load First-class abstractions: - abstract classes - interface types Generics Names : class, method, variable

Names Q: What should a variable name tell you? Q: What should a method name tell you? Q: What should a class name tell you? A: As much as possible from as little effort as possible E.g: which is clearer: CustomerRepository or FindCustomersByLocationQuery? SmsService or SmsSender? What are the responsibilities of SmsService? What are the responsibilities of SmsSender? Which is more expressive? Which shows more empathy for the user? Which describes its responsibilities better?

Other techniques Small methods Small classes Minimal scope Pairing Minimal state TDD No nesting Patterns Consistent format/style Early returns

Good code is easy to understand and reason about

Write code for people NOT computers