Write programs that do
one thing and do it well.
Write programs to work together.
Write programs to handle
text streams,
because that is
a universal interface.
Doug McIlroy,
Bell Labs CSRC
HTTP
Slide 47
Slide 47 text
Design Considerations
Implement an
ecosystem of
small applications.
Slide 48
Slide 48 text
Design Considerations
Divide models between
the applications.
Slide 49
Slide 49 text
Design Considerations
Persistence is a service.
Slide 50
Slide 50 text
Design Considerations
Bind applications together
using APIs and messaging.
Slide 51
Slide 51 text
Design Considerations
Determine a
caching strategy.
Slide 52
Slide 52 text
Design Considerations
Pick a messaging
solution.
Slide 53
Slide 53 text
Rethinking
Architecture
Slide 54
Slide 54 text
Roots Rock.
Slide 55
Slide 55 text
A Sudden Revelation
What if we
think of an application...
...as just another object?
Slide 56
Slide 56 text
Object-Oriented
Architecture
Slide 57
Slide 57 text
Theoretical Backing
Apply OO design principles
to the architecture itself.
Slide 58
Slide 58 text
Classes communicating
via messages
Applications communicating
via APIs & queues
!
Theoretical Backing
Slide 59
Slide 59 text
Applying OO Principles
An application is a group
of components that
perform tasks
on the same data.
Slide 60
Slide 60 text
Applying OO Principles
An application should do
one well-defined thing.
Slide 61
Slide 61 text
Applying OO Principles
APIs allow us to easily
extend our interfaces.
Slide 62
Slide 62 text
Applying OO Principles
It doesn’t matter what
application sends,
receives or processes
our messages.
Slide 63
Slide 63 text
Applying OO Principles
APIs and presenters
allow us to easily
create client-specific
interfaces.
Slide 64
Slide 64 text
Legacy
Applications
Slide 65
Slide 65 text
What is a legacy app?
Age is not measured
in months or years
or versions.
Slide 66
Slide 66 text
What is a legacy app?
Legacy code is not broken.
Slide 67
Slide 67 text
What is a legacy app?
Don’t git blame.
Slide 68
Slide 68 text
What is a legacy app?
A storehouse of
information about
a problem space.
Slide 69
Slide 69 text
Refactoring Tactics
Dismantle god classes.
Slide 70
Slide 70 text
Refactoring Tactics
Extract behaviors
into modules.
Slide 71
Slide 71 text
Refactoring Tactics
Extract models and
business logic
into engines.
Slide 72
Slide 72 text
Refactoring Tactics
Migrate engines into
discrete applications.
Slide 73
Slide 73 text
Refactoring Tactics
Implement observers
using a messaging service.
Slide 74
Slide 74 text
Refactoring Tactics
Provide persistence through
asynchronous services.
Slide 75
Slide 75 text
Refactoring Tactics
Direct calls between
applications rely on
a good set of APIs.
Slide 76
Slide 76 text
Refactoring Tactics
Use your API as
a guide to refactoring
your models.
Slide 77
Slide 77 text
Synchronous Calls via APIs
Credentials
Auth Token
Auth
Service
Client
App
Slide 78
Slide 78 text
Asynchronous Calls via
Message Queues
Prefs Update
Client
App
Attr Change
Persistence
Service
Slide 79
Slide 79 text
Refactoring Tactics
Find functional edges
and refactor them
into services.
Slide 80
Slide 80 text
Refactoring Tactics
Make liberal use of the
presenter pattern.
Slide 81
Slide 81 text
A declarative
framework
useful for
building APIs.
faceted.rb
Slide 82
Slide 82 text
On the Other Side
of Refactoring
Slide 83
Slide 83 text
A Small App Ecosystem
Consumer
App
Internal
App 1
Internal
App 2
Persistence
API
Messaging
API
Reporting
API
Dashboard
App
Slide 84
Slide 84 text
Reap the Benefits
Reduced cost
of change.
Slide 85
Slide 85 text
Reap the Benefits
Support for unexpected
and novel use cases.
Slide 86
Slide 86 text
Reap the Benefits
Reduction of ceremony
around releases.
Slide 87
Slide 87 text
Reap the Benefits
Low-impact downtime.
Slide 88
Slide 88 text
Reap the Benefits
Short ramp-up time
for new developers.
Slide 89
Slide 89 text
Reap the Benefits
Increased performance
of test suites.
Slide 90
Slide 90 text
Reap the Benefits
A/B testing
on applications and
infrastructure.
Slide 91
Slide 91 text
Reap the Benefits
Greater
flexibility.
Slide 92
Slide 92 text
Reap the Benefits
Democratization of
application architecture.