+ All Categories
Home > Technology > Design principles in software development

Design principles in software development

Date post: 15-Jul-2015
Category:
Upload: rinat-khabibiev
View: 59 times
Download: 3 times
Share this document with a friend
Popular Tags:
13
Design Principles Rinat Khabibiev
Transcript
Page 1: Design principles in software development

Design PrinciplesRinat Khabibiev

Page 2: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES

● KISS (Keep It Simple, Stupid!) ● YAGNI (You Aren't Going to Need It) ● Don't make me think ● Write code for the maintainer ● DRY (Don’t Repeat Yourself) ● SOLID

Table of contents

Page 3: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: KISS

Best code is not written code.

Best solution is make it unnecessary.

Keep It Simple Stupid! (KISS)

Page 4: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: YAGNI

• Every feature need to be tested after every code refactoring,

do you really need all this stuff?

• Ideal solution is YAGNI.

You Aren't Going to Need It (YAGNI)

Page 5: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: DON'T MAKE ME THINK

• I do not have enough time to think how it works.

• Comments is good but it isn’t crucial.

- One does not simply write code

Don't make me think

Page 6: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: WRITE CODE FOR THE MAINTAINER

• Avoid spaghetti code.

• Every entity should be available by Ctrl/Cmd + click.

This is crazy maintainer, he knows where you live

Write code for the maintainer

Page 7: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• Every piece of knowledge must have single, unambiguous,

obvious representation.

Don’t Repeat Yourself (DRY)

Page 8: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• One goal for single entity.

SOLID: Single responsibility

Page 9: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• Software entities should be closed for modification.

• Software entities should be open for extension.

SOLID: Open/closed principle

Page 10: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• If B is subclass of A then B objects may be used instead of A

objects.

SOLID: Liskov substitution principle

Page 11: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• Several specialized interfaces is better than one universal.

SOLID: Interface segregation principle

Page 12: Design principles in software development

* www.ExigenServices.com

DESIGN PRINCIPLES: SINGLE RESPONSIBILITY

• High-level modules should not depend on low-level modules.

• Abstractions should not depend on details.

Example of bad design

SOLID: Dependency inversion principle

Page 13: Design principles in software development

* www.ExigenServices.com

PHPUNIT: MOCK OBJECTS

The end


Recommended