Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Creating and managing Graph instances

Our graph processing system is nearly complete! To finalize our implementation, we need to define a constructor that will create new Graph instances and some auxiliary methods that will manage the graph's life cycle.

As we saw in the previous sections, there are quite a few knobs for configuring Graph instances. Passing each individual configuration option as an argument to the graph's constructor is considered to be an anti-pattern – not to mention that we would have to bump the major version of our package every time we want to add a new configuration option; changing a constructor's signature is the very definition of a breaking change!

A much better solution is to define a typed configuration object ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content