ABSTRACT ART GETTING ABSTRACTION JUST RIGHT Presented by Jeremy - - PowerPoint PPT Presentation

abstract art
SMART_READER_LITE
LIVE PREVIEW

ABSTRACT ART GETTING ABSTRACTION JUST RIGHT Presented by Jeremy - - PowerPoint PPT Presentation

ABSTRACT ART GETTING ABSTRACTION JUST RIGHT Presented by Jeremy Clark www.jeremybytes.com A Good Design is like A Piece of Art Geek & Poke http://goo.gl/ifd53l @jeremybytes ABSTRACTION IS AWESOME! Maintain Test Extend


slide-1
SLIDE 1

ABSTRACT ART

GETTING ABSTRACTION “JUST RIGHT”

Presented by Jeremy Clark www.jeremybytes.com

slide-2
SLIDE 2

Geek & Poke – http://goo.gl/ifd53l

A Good Design is like A Piece of Art

@jeremybytes

slide-3
SLIDE 3

ABSTRACTION IS AWESOME! Maintain Test Extend

@jeremybytes

slide-4
SLIDE 4

ABSTRACTION IS AWFUL! Complexity Debugging Difficulty Confusion

Frustration

@jeremybytes

slide-5
SLIDE 5

https://archive.org/details/goldilocks_and_the_three_bears

slide-6
SLIDE 6

GOLDILOCKS THE DEVELOPER

Too Much Abstraction Too Little Abstraction Just Right

@jeremybytes

slide-7
SLIDE 7

TWO TYPES OF DEVELOPERS

Over-Abstractor Under-Abstractor

@jeremybytes

slide-8
SLIDE 8
  • “We’ll have a good use for this in the future.”
  • Overly Complex
  • Difficult to Maintain

Over-Abstractor

@jeremybytes

slide-9
SLIDE 9

A Good Architect Leaves A Footprint

Geek & Poke: http://goo.gl/B4uXa3

@jeremybytes

slide-10
SLIDE 10
  • “Let’s keep things simple.”
  • Rigid
  • Difficult to Maintain

Under-Abstractor

@jeremybytes

slide-11
SLIDE 11

COMMON PROBLEM

  • “We’ll have a good use for this in the future.”
  • Overly Complex
  • Difficult to Maintain

Over-Abstractor

  • “Let’s keep things simple.”
  • Rigid
  • Difficult to Maintain

Under-Abstractor

@jeremybytes

slide-12
SLIDE 12

The Default State Quiz Who Are You?

slide-13
SLIDE 13

Let’s build a plug-in architecture…

Awesome! Let’s do it. Maybe we should look at compile-time

  • ptions.
slide-14
SLIDE 14

We need to share a value between modules…

I’ll create an

  • bject state

manager. Let’s use a global variable.

slide-15
SLIDE 15

How should we do the UI?

Here’s a new JavaScript framework. Let’s use the same framework we did last time.

slide-16
SLIDE 16

Pull data from a database…

ORMs are awesome! SELECT * FROM Customers WHERE ID = [@id]

slide-17
SLIDE 17

We need an object instance…

var logger = DIContainer .Resolve<ILogger>() var logger = new FileLogger()

slide-18
SLIDE 18

Neither answer is right or wrong. The correct response is “It depends.”

—Jeremy’s Standard Response

slide-19
SLIDE 19

Let’s build a plug-in architecture…

Awesome! Let’s do it. Maybe we should look at compile-time

  • ptions.
slide-20
SLIDE 20

We need to share a value between modules…

I’ll create an

  • bject state

manager. Let’s use a global variable.

slide-21
SLIDE 21

How should we do the UI?

Here’s a new JavaScript framework. Let’s use the same framework we did last time.

slide-22
SLIDE 22

Pull data from a database…

ORMs are awesome! SELECT * FROM Customers WHERE ID = [@id]

slide-23
SLIDE 23

We need an object instance…

var logger = DIContainer .Resolve<ILogger>() var logger = new FileLogger()

slide-24
SLIDE 24

BE HONEST WITH YOURSELF

Too Much Abstraction Too Little Abstraction Just Right

@jeremybytes

slide-25
SLIDE 25

WHO AM I?

  • Hello. My name is Jeremy,

and I’m an Under-Abstractor. Under-Abstractor “Keep Things Obvious” “Don’t Be Tricky”

slide-26
SLIDE 26

REPORTING APPLICATION

slide-27
SLIDE 27

THE PENDULUM EFFECT

Over- Abstraction Under- Abstraction Just Right

slide-28
SLIDE 28

THOSE AROUND YOU

  • Jeff loved to build components.
  • He liked to create code for re-use.
  • He thought of all possible scenarios.

Over-Abstractor

slide-29
SLIDE 29

A SYMBIOTIC RELATIONSHIP

The Over-Abstractor helps the Under-Abstractor get things Just Right The Under-Abstractor helps the Over-Abstractor get things Just Right

slide-30
SLIDE 30

Know Your… Environment Self Tools Infrastructure Business Team

slide-31
SLIDE 31

THE PENDULUM EFFECT

Over- Abstraction Under- Abstraction Just Right

@jeremybytes

slide-32
SLIDE 32

VARIOUS DATA SOURCES

MongoDB Amazon AWS Microsoft Azure WebAPI CSV SOAP Service Microsoft SQL Server Oracle JSON Hadoop

@jeremybytes

slide-33
SLIDE 33

PLUGGABLE REPOSITORIES

@jeremybytes

Service Repository CSV File Repository SQL Database Repository Application

slide-34
SLIDE 34

@jeremybytes

slide-35
SLIDE 35

DRY

  • Don’t Repeat Yourself

@jeremybytes

Under-Abstractor

slide-36
SLIDE 36

DON’T REPEAT YOURSELF

Consolidate Similar Code Avoid Copy/Paste Copy/Pasta Spaghetti Code

@jeremybytes

slide-37
SLIDE 37

SoC

  • Separation of Concerns

@jeremybytes

Under-Abstractor

slide-38
SLIDE 38

SINGLE RESPONSIBILITY PRINCIPLE

Complements Separation of Concerns The “S” in S.O.L.I.D. A class should have only one reason to change A class should do one thing (and do it well)

@jeremybytes

slide-39
SLIDE 39

YAGNI

  • You Ain’t Gonna Need It
  • (You Aren’t Going to Need It)

@jeremybytes

Over-Abstractor

slide-40
SLIDE 40

MORAL OF YAGNI

  • Code for the features you have now
  • Add abstraction as you need it
  • Don’t add abstraction based on speculation

We still think about the future, but we don’t implement it yet.

@jeremybytes

slide-41
SLIDE 41

KISS

  • Keep It Simple, Stupid
  • (Keep It Short & Simple)
  • (Keep It Simple & Straightfoward)

@jeremybytes

Over-Abstractor

slide-42
SLIDE 42

DDIY

  • Don’t Do It Yourself

@jeremybytes

Over-Abstractor Under-Abstractor

slide-43
SLIDE 43

DDIY

  • Over-Abstractors like to build

things to solve specific problems Over-Abstractor

  • Under-Abstractors shy away from

external frameworks and libraries Under-Abstractor

@jeremybytes

slide-44
SLIDE 44

EXAMPLES

Dependency Injection

  • Unity, MEF, Ninject, Autofac, StructureMap, Spring.NET

Unit Testing Framework

  • MSTest, NUnit, TypeMock Isolator, xUnit.net, Approval Tests

Mocking

  • Moq, NSubstitute, RhinoMocks, FakeItEasy, JustMock

Logging

  • log4net, Semantic Logging Application Block (SLAB)

UI Framework

  • Prism, Angular, React

@jeremybytes

slide-45
SLIDE 45

ABSTRACTION IS AWESOME & AWFUL

Maintain Test Extend Complexity Debugging Difficulty Confusion

@jeremybytes

slide-46
SLIDE 46

THE GOLDILOCKS PRINCIPLE

Too Much Abstraction Too Little Abstraction Just Right

@jeremybytes

slide-47
SLIDE 47

GETTING THINGS RIGHT

DRY

  • Don’t Repeat

Yourself

SoC

  • Separation of

Concerns

YAGNI

  • You Ain’t

Gonna Need It

KISS

  • Keep It Short &

Simple

DDIY

  • Don’t Do It

Yourself

@jeremybytes

slide-48
SLIDE 48

THANK YOU! Jeremy Clark

  • http://www.jeremybytes.com
  • jeremy@jeremybytes.com
  • @jeremybytes

@jeremybytes