Beginning Software Craftsmanship Brendan Enrick Steve Smith

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Chapter 11 Component-Level Design
Since 1995, we’ve been building innovative custom solutions specifically designed to meet the unique needs of America’s most recognized companies. If you.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
SOLID Object Oriented Design Craig Berntson
Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Test-Driven Development “Test first, develop later!” –OCUnit.
B USINESS LAYER SAMANVITHA RAMAYANAM 4 th MARCH 2010 CPE 691.
Object-oriented metrics Design decisions: Class Cohesion Open-Closed Single Responsibility Interface Segregation Dependency Inversion Liskov Substitution.
Building SOLID Software with Dependency Injection Jeremy Rosenberg.
CLASS DESIGN PRINCIPLES Lecture 2. The quality of the architecture What is a good design? It is the design that at least does not have signs of “bad”.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
CIT 590 Intro to Programming Style Classes. Remember to finish up findAllCISCourses.py.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
CSE 301 Exam Revision Lecture
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
CSSE 374: More GRASP’ing for Object Responsibilities
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
SOLID Principles in Software Design
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
CPSC 372 John D. McGregor Module 4 Session 1 Design Patterns.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
The benefits of SOLID in software development Ruben Agudo Santos (GS-AIS-HR)
 What is SOLID  The S in SOLID  The O in SOLID  The L in SOLID  The I in SOLID  The D in SOLID  Questions.
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
CPSC 871 John D. McGregor Module 5 Session 1 Design Patterns.
PRINCIPLES OF GOOD DESIGN 12/7/ Assignment 4 – Deadline 28 Nov.  Read an article placed in generalshare course folder  Point: Design Patterns.
Thanks for Coming l WEB. Principles of Good Design SEI, SJTU WEB APPS and SERVICES.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Five design principles
Design and Planning Or: What’s the next thing we should do for our project?
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
PRINCIPLES OF OBJECT ORIENTED DESIGN S.O.L.I.D. S.O.L.I.D Principles What is SOLID?  Acrostic of 5 Principles:  The Single Responsibility Principle.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
SOLID Design Principles
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
SOLID Principles in Software Design
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
CSCE 240 – Intro to Software Engineering Lecture 3.
14 Jul 2005CSE403, Summer'05, Lecture 09 Lecture 09: Fundamental Principles and Best Practices for Software Design Valentin Razmov.
Mantas Radzevičius ifm-2/2
“When quality is critical"
Software Architecture & Difference from Design
How to be a Good Developer
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
How to be a Good Developer
object oriented Principles of software design
How to be a Good Developer
Component-Level Design
Software Design Lecture : 14.
Object Oriented Practices
Questions First On class? On project? On material we’ve discussed?
A (partial) blueprint for dealing with change
Object Oriented Design & Analysis
Dependency Inversion principle
Some principles for object oriented design
Presentation transcript:

Beginning Software Craftsmanship Brendan Enrick Steve Smith

Key Principles Keep It Simple YAGNI Don’t Repeat Yourself Separation of Concerns Explicit Dependencies Single Reponsibility Open/Closed Liskov Substitution Interface Segregation Dependency Inversion Don’t Repeat Yourself

The General Principle “The General Principle of Software Quality is that improving quality reduces development costs.” - Steve McConnell, Code Complete

Keep It Simple KISS Simple solutions are easier to understand than complex ones “Everything should be as simple as possible, but no simpler.” – Albert Einstein

1.Passes its tests 2.Minimizes duplication 3.Maximizes clarity 4.Has fewer elements Simple Design – Kent Beck

YAGNI You Aren’t Gonna Need It Build what is needed today, today Keep code clean and simple; adding to it tomorrow will be straightforward Don’t waste time building things you might need

Don’t Repeat Yourself Every concept in your application should have a single, canonical place in which it is defined. Avoid copy-paste programming Repetition is the root of all programming evil. Duplication in process -> automation Duplication in logic-> abstraction

Separation of Concerns Separate code by responsibility Separate code by abstraction level Separate solution modules by their architectural layer Prefer modular code communicating through well- defined interfaces

Explicit Dependencies Methods and classes should explicitly require any collaborators they need in order to function correctly. Implicit, hidden dependencies are a frequent source of bugs Implicit dependencies promote tight coupling Be aware of static method calls and the new keyword –Remember, “new is glue”

Single Responsibility Classes should have only one reason to change. Examples: Persistence Validation Notification Error Handling Logging Collaborator selection / construction

Open/Closed Software entities should be open to extension, but closed to modification Clients should be able to change the entity’s behavior Doing so should not require altering the entity’s source code Apply only when change is likely.

Liskov Substitution Subtypes must be substitutable for their base types. “Is-A” is not sufficient; “Is- Substitutable-For” is required Look for type checking in polymorphic code as a “code smell” indicating this principle is being violated

Interface Segregation Don’t force clients to depend on methods they do not need Clients should define their interfaces Break large interfaces up into smaller ones

Dependency Inversion High level modules should not depend on low level modules. Both should depend on abstractions. Abstractions should not depend on details; details should depend on abstractions Invert typical code dependency directionality

Don’t Repeat Yourself Advice that is worth repeating Many design patterns exist solely to achieve this principle Clean up duplication whenever you can in your code

Pain Driven Development Don’t try to apply every principle, all the time Keep It Simple YAGNI Follow principles when their violation is causing you pain.

DISCUSS

Thank you! Brendan brendan.enrick.com Steve ardalis.com ng/Authors/Details/steve- smith