SlideShare a Scribd company logo
Author Date
Go best practices
Go naviro
Founder of Encore
André Eriksson
Coder. Ex-Spotifier. Puppy caretaker.
Founder of Encore
André Eriksson
Coder. Ex-Spotifier. Puppy caretaker.
Simplicity
Simplicity
Complexity
Complexity
What is complexity?
What is complexity?
What is complexity?
What is complexity?
What is complexity?
"The state or quality of being intricate or complicated."
What is complexity?
"Complexity is anything related to the structure of a
software system that makes it hard to understand and
modify the system."
What is complexity?
— A Philosophy of Software Design
The Complexity Equation
The Complexity Equation
"The sum of (the complexity of each part times the
fraction of time spent developing that part)"
Go Best Practices – Interfaces, Packages and APIs
Human working memory can only hold a few (3-4)
items at a time.
Chunking
M D P H D R S V P C E O I H O P
Chunking
MD PHD RSVP CEO IHOP
Chunking
Modular Design
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Systems should be designed by breaking them down into smaller parts, or modules
We can keep breaking things down
Application
Everything your application
does
Application
Everything your application
does
Systems
Large, independent parts
of the application
Application
Everything your application
does
Systems
Large, independent parts
of the application
Services
Parts of a system that
are separated by
a network boundary
Systems
Large, independent parts
of the application
Services
Parts of a system that
are separated by
a network boundary
Components
A service is made up of
one or more components
Packages
A component is made up of
Go packages
Services
Parts of a system that
are separated by
a network boundary
Components
A service is made up of
one or more components
Packages
A component is made up of
Go packages
Types, Functions, etc
Parts that make up a package
How we break things down matters a great deal
Interfaces
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
"A point where two systems, subjects, organizations, etc. meet and interact."
"A point where two systems, subjects, organizations, etc. meet and interact."
"A point where two systems, subjects, organizations, etc. meet and interact."
"A device or program enabling a user to communicate with a computer"
Go Best Practices – Interfaces, Packages and APIs
To properly divide our application into modules,
we need to think about the interfaces between modules.
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Best Practice #1
Great interfaces require thinking ahead.
Interface Design
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Go Best Practices – Interfaces, Packages and APIs
Deep Module
Deep Module Shallow Module
Deep Module Shallow Module ?
Best Practice #2
Great modules are deep.
Information Hiding
Deep modules
isolate the caller
from something
Deep modules
isolate the caller
from something
Deep modules
isolate the caller
from something
Deep modules
isolate the caller
from something
Deep modules
isolate the caller
from design decisions
Go Best Practices – Interfaces, Packages and APIs
Interfaces create problems
Interfaces create problems
Interfaces create problems
Interfaces solve problems
Interfaces solve problems
for the consumer
Favor the consumer
over the provider
Simple interface
over simple implementation
Design interfaces
together with consumers
Test your designs
with real-world use cases
Best Practice #3
Great modules isolate complexity.
Quiz Time!
Package structure
When to split a package?
When to split a package?
Minimize total complexity
When to split a package?
•
Minimize total complexity
Best information hiding
When to split a package?
•
•
Minimize total complexity
Best information hiding
Fewest dependencies
When to split a package?
•
•
•
Minimize total complexity
Best information hiding
Fewest dependencies
Deepest interfaces
Domain oriented design
Domain oriented design
Good
Good Bad
Domain oriented design
Best Practice #Bonus
Everything is a trade-off.
 
 
Thecloudnativebackenddevelopmentplatform
Thebackend
frameworkwith
superpowers.
 
•
•
•
•
Create backend services and call APIs with a single line of code
Automatically sets up your cloud infrastructure
Built-in state of the art debugging tools
Handles any scale, out of the box
 
Superpowers
•
•
•
•
Startups building web or mobile apps
Want to focus on building their product
May not have experienced backend developers
Want a more enjoyable development experience
 
Who is it for?
 
LiveDemo
Thanks!Questions?
@_eandre

More Related Content

PDF
Interusability: designing a coherent system UX
PDF
Interusability: designing a coherent system UX: NUX 23.10.15
PDF
Over the Air 15: Experience design for the IoT: system UX & interusability 15...
PDF
Interusability: Designing a Coherent System UX
PDF
Direct manipulation is broken: O'Reilly Design Conference Jan 2016
PDF
UXLx 2015: 'Designing Connected Products workshop
PDF
UX Day Mannheim: UX for systems of connected products
PDF
Design for failure in the IoT: what could possibly go wrong?
Interusability: designing a coherent system UX
Interusability: designing a coherent system UX: NUX 23.10.15
Over the Air 15: Experience design for the IoT: system UX & interusability 15...
Interusability: Designing a Coherent System UX
Direct manipulation is broken: O'Reilly Design Conference Jan 2016
UXLx 2015: 'Designing Connected Products workshop
UX Day Mannheim: UX for systems of connected products
Design for failure in the IoT: what could possibly go wrong?

Similar to Go Best Practices – Interfaces, Packages and APIs (20)

PDF
Excavating the knowledge of our ancestors
PPTX
Software Architectures, Week 1 - Monolithic Architectures
PDF
Software engineering the genesis
PDF
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
PDF
Structured Software Design
PDF
Foundations of Scalable Systems - Designing Distributed Architectures 1st Edi...
PDF
Journey from Monolith to a Modularized Application - Approach and Key Learnin...
PPS
Vp all slides
PDF
TDC 2017 - Vale a pena utilizar Docker em produção?
PDF
Creating An Incremental Architecture For Your System
PDF
Old Is the New New
PPTX
DDD In Agile
PPTX
Let's talk about... Microservices
PDF
Essential Complexity in Systems Architecture
PDF
Creating An Incremental Architecture For Your System
PPTX
L23 Summary and Conclusions
PPT
Design patterns
PPTX
Software Architecture for Agile Development
PDF
META for Microservices: Getting your enterprise migration in motion
PPT
7. Design Concepts.pptbhhbbbbhjijjnnnnnnnn
Excavating the knowledge of our ancestors
Software Architectures, Week 1 - Monolithic Architectures
Software engineering the genesis
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
Structured Software Design
Foundations of Scalable Systems - Designing Distributed Architectures 1st Edi...
Journey from Monolith to a Modularized Application - Approach and Key Learnin...
Vp all slides
TDC 2017 - Vale a pena utilizar Docker em produção?
Creating An Incremental Architecture For Your System
Old Is the New New
DDD In Agile
Let's talk about... Microservices
Essential Complexity in Systems Architecture
Creating An Incremental Architecture For Your System
L23 Summary and Conclusions
Design patterns
Software Architecture for Agile Development
META for Microservices: Getting your enterprise migration in motion
7. Design Concepts.pptbhhbbbbhjijjnnnnnnnn
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Artificial Intelligence
PDF
composite construction of structures.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Lecture Notes Electrical Wiring System Components
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPT
Mechanical Engineering MATERIALS Selection
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
DOCX
573137875-Attendance-Management-System-original
PPTX
Construction Project Organization Group 2.pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
PPT on Performance Review to get promotions
OOP with Java - Java Introduction (Basics)
Artificial Intelligence
composite construction of structures.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
Lecture Notes Electrical Wiring System Components
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Mechanical Engineering MATERIALS Selection
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
R24 SURVEYING LAB MANUAL for civil enggi
Automation-in-Manufacturing-Chapter-Introduction.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
573137875-Attendance-Management-System-original
Construction Project Organization Group 2.pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
bas. eng. economics group 4 presentation 1.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Internet of Things (IOT) - A guide to understanding
PPT on Performance Review to get promotions
Ad

Go Best Practices – Interfaces, Packages and APIs