Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Metaprinciples of Software Development

Elias Fofanov

http://engineerspock.com
Outline

• DRY or “Don’t Repeat Yourself”


• KISS or “Keep it Simple, Stupid”
• YAGNI or “You Ain’t Gonna Need”
• SoC or “Separation of Concerns”
• CQS or “Command-Query Separation”
• The Law of Demeter or the principle of Least Knowledge
• Principle of Least Astonishment
• Information hiding and Encapsulation
Next Video
DRY Principle
Next Video
SRP Outline
Single Point Slide

Good for making a single point, or


recapping a particular concept that
you’ve just covered.
You can either use both text
columns, a single text column, or
half and half with an accompanying
image.
20XX 20XX 20XX 20XX
Multi Point Slide

● Good for making multiple points in one slide, or for anything that needs a
large amount of space in general
● In general between three to five bullet points is about right, any more than
that and everything starts to look a bit like a wall of text
● Also ideal for large charts, still images - animated GIFs can work as well if
you’re using Google Slides
Using Diagrams and Shapes

Step 3
Step 2 We challenge you to create
Step 1 and build your own examples
We show you how to analyse
We help you understand
and apply what you’ve seen
and remember key points
This format is ideal for quick
summaries and explaining the
reasoning behind certain
Why? decisions.
Development can be
Because this is the responsible
thing to do opinionated; and that’s totally
fine. Just bring the audience
along with you.
Metaprinciples of Software Development

Elias Fofanov

http://engineerspock.com
Outline

• DRY or “Don’t Repeat Yourself”


• KISS or “Keep it Simple, Stupid”
• YAGNI or “You Ain’t Gonna Need”
• SoC or “Separation of Concerns”
• CQS or “Command-Query Separation”
• The Law of Demeter or the principle of Least Knowledge
• Principle of Least Astonishment
• Information hiding and Encapsulation
Next Video
DRY Principle
SOLID VS YAGNI
Outline

• Fixing problems we ended up with more complex design


• Blind application of SOLID leads to Needless Complexity
• Needless Complexity often is the result of YAGNI violation
“Developers have a tendency to attempt to solve
specific problems with general solutions.”

Greg Young
What we if really need to make code more general?
Reused Abstraction Principle (RAP)

• RAP states that there should be at least three implementers on an interface or a base class
(Rule of Three)
• Abstraction eliminates irrelevant and amplifies the essential

Basic algorithm:
• Start with a concrete implementation of a specific behavior
• Observe the emerging commonalities
• Apply the Rule of Three
Next Video
OCP vs YAGNI
OCP VS YAGNI

YAGNI means that we don’t need to introduce any abstractions until we


really need them => OCP or YAGNI?
Right answer: it depends.

• YAGNI beats OCP in case of private API


• OCP beats YAGNI in case of public API
Next Video
SRP and ISP. What’s the Difference?
SRP and ISP
SRP and ISP

• SRP implies that a class should have only one reason to change.
ISP at the same time tells that clients should not depend
on things they do not need.
• ISP and SRP are different views on the same idea.
SRP is more focused on the designer-side point-of-view,
while ISP is more focused on the client-side point-of-view.
SRP and ISP

class Persister : IReader, Iwriter {


public byte[] Read(string file) {

public void Write(byte[] content) {

}
}

interface IReader {
byte[] Read(string file);
}

interface IWriter {
void Write(byte[] content);
}
Next Video
Architecture and Design
Architecture and Design
What is the difference between Architecture and Design?
What is the difference between Architecture and Design?
Architecture

• Any software system has an architecture


• There’s no “the highest level of abstraction of a system”
• Architecture has a social role (communicative)
Another bad definition:
Architecture is the decisions that you wish you could get right
early in a project.
Architecture

• DBMS and UI are just tools


• Strive to make tools irrelevant
Design

• Software design is about designing the individual modules or components


• What are the responsibilities, functions, of module x? Of class Y?
What can it do, and what not?
Architecture and Design Patterns

• Architecture Patterns are standard forms of relationships between


components that deemed significant.
For example:
• 2-tier
• 3-tier
• SOA
• Event-Driven
• Cloud
• Design Patterns – behavioral, structural, creational.

You might also like