Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.

Slides:



Advertisements
Similar presentations
Design Principles & Patterns
Advertisements

Since 1995, we’ve been building innovative custom solutions specifically designed to meet the unique needs of America’s most recognized companies. If you.
St Louis Day of.NET 2011 Refactoring to a SOLID Foundation Steve Bohlen Senior Software Engineer SpringSource/VMware Blog:
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
17.10 Java Beans Java beans are a framework for creating components in Java. AWT and Swing packages are built within this framework Made to fit in with.
1 Software Maintenance and Evolution CSSE 575: Session 6, Part 1 The “SEAM” Model Steve Chenoweth Office Phone: (812) Cell: (937)
Liskov Substitution Principle
Criteria for good design. aim to appreciate the proper and improper uses of inheritance and appreciate the concepts of coupling and cohesion.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
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 OO Design Novosoft, 2001 by V. Mukhortov. 2 OO Design Goals  Flexibility Changes must be localized  Maintainability Modules requiring changes can.
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
Software Engineering. Administrivia This is me: Cyndi Rader You can reach me: Or find me here: BB 280D Class notes here:
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
CSE 301 Exam Revision Lecture
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
Башкирцев (Старовер) Станислав JavaTalks OOD Principles.
SOLID Principles in Software Design
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
Design Principles iwongu at gmail dot com.
The benefits of SOLID in software development Ruben Agudo Santos (GS-AIS-HR)
Using Mock Objects with Test Driven Development Justin Kohlhepp
 What is SOLID  The S in SOLID  The O in SOLID  The L in SOLID  The I in SOLID  The D in SOLID  Questions.
Software Design Principles
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.
OO Design Principles Copyright © Vyacheslav Mukhortov, Nikita Nyanchuk-Tatarskiy, Copyright © INTEKS LLC,
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Design for testability as a way to good coding Simone Chiaretta Architect, Council of the EU December 9 th,
High Cohesion Low Coupling Old Standards for Object Oriented Programming.
Five design principles
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Principles of Object Oriented 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.
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.
Dependency Inversion Principle Jon McBee Principal Software Engineer Ultratech CNT.
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
F-1 © 2007 T. Horton CS 4240 Principles of SW Design More design principles LSP, OCP, DIP, … And another pattern Decorator.
SOLID PHP & Code Smell Wrap-Up
Liskov Substitution Principle Jon McBee CLA, CLED, CTD, CPI, LabVIEW Champion.
Microsoft Advertising 16:9 Template Light Use the slides below to start the design of your presentation. Additional slides layouts (title slides, tile.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
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
Course information Old exam Resit Report Result and walkthrough
Object-Orientated Analysis, Design and Programming
Software Architecture & Difference from Design
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2004.
Hao Zhong Shanghai Jiao Tong University
Copyright © by Curt Hill
Agile Software Development
Adaptive Code Umamaheswaran Senior Software Engineer
Object Oriented Practices
lecture 08, OO Design Principle
11/29/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Object-Oriented Design
Software Design Lecture : 14.
15 letters that will change your code
The SOLID Principles.
A (partial) blueprint for dealing with change
European conference.
Object Oriented Design & Analysis
Some principles for object oriented design
Liskov Substitution Principle (LSP)
Chapter 10 – Component-Level Design
Presentation transcript:

Introduction to SOLID Principles

Background

Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle

S: Single Responsibility Principle (SRP) “Every class should have a single responsibility, and that responsibility should be entirely encapsulated by that class”

1.When we need to modify the way we save Customer data 2.When we want to revise the way we log our Exceptions The Customer class has 2 reasons to change:

Difficulty in naming classes can be a sign that you are trying to do too much, and that this class is taking on too much responsibility Do One Thing: methods that only do one thing are usually very short: 3-5 lines Multiple unit tests for the same method should be a warning sign that you are doing too much SRP - Tips

O: Open/Closed Principle (OCP) “Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.”

O: Open/Closed Principle (OCP) Open for extension – you can extend an object’s behaviour Closed for modification – without the need to modify any existing code

L: Liskov Substitution Principle (LSP) “If S is a subtype of T, then objects of type T may be replaced with objects of type S without altering any of the desirable properties of that program”

Favour Interfaces over inheritance (Google this…you’ll find loads!) Use inheritance sparingly. Keep inheritance hierarchies from getting to big – aim for no more than two or three deep. LSP - Tips

I: Interface Segregation Principle (ISP) “No client should be forced to depend on methods it does not use.”

D: Dependency Inversion Principle (DIP) “A. High-level modules should not depend on low-level modules. Both should depend on abstractions. B. Abstractions should not depend on details. Details should depend on abstractions.”

Unity Castle Windsor IOC Containers

Questions

Follow Us Dave