Reader small image

You're reading from  Hands-On Software Engineering with Golang

Product typeBook
Published inJan 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838554491
Edition1st Edition
Languages
Right arrow
Author (1)
Achilleas Anagnostopoulos
Achilleas Anagnostopoulos
author image
Achilleas Anagnostopoulos

Achilleas Anagnostopoulos has been writing code in a multitude of programming languages since the mid 90s. His main interest lies in building scalable, microservice-based distributed systems where components are interconnected via gRPC or message queues. Achilleas has over 4 years of experience building production-grade systems using Go and occasionally enjoys pushing the language to its limits through his experimental gopher-os project: a 64-bit kernel written entirely in Go. He is currently a member of the Juju team at Canonical, contributing to one of the largest open source Go code bases in existence.
Read more about Achilleas Anagnostopoulos

Right arrow

Summary

In the first section of this chapter, The SOLID principles of object-oriented design, we performed a deep dive into each of the SOLID principles and how they can be applied toward writing clean Go code:

  • SRP: Group structs and functions based on their purpose and organize them into packages with clear logical boundaries.
  • Open/Closed principle: Use composition and embedding of simple types to construct more complex types that still retain the same implicit interface as the types they consist of.
  • LSP: Avoid unnecessary coupling by using interfaces rather than concrete types to define the contract between packages.
  • ISP: Make sure your function or method signatures only depend on the behaviors they need and nothing more; use the smallest possible interface to describe function/method arguments and avoid coupling to the implementation details of concrete types.
  • DIP: Use the...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Software Engineering with Golang
Published in: Jan 2020Publisher: PacktISBN-13: 9781838554491

Author (1)

author image
Achilleas Anagnostopoulos

Achilleas Anagnostopoulos has been writing code in a multitude of programming languages since the mid 90s. His main interest lies in building scalable, microservice-based distributed systems where components are interconnected via gRPC or message queues. Achilleas has over 4 years of experience building production-grade systems using Go and occasionally enjoys pushing the language to its limits through his experimental gopher-os project: a 64-bit kernel written entirely in Go. He is currently a member of the Juju team at Canonical, contributing to one of the largest open source Go code bases in existence.
Read more about Achilleas Anagnostopoulos