---
title: "Discussion on \"Design Patterns in Rust 🦀: An Introduction to the Builder Pattern\" | Hashnode"
description: "Discussion on \"Design Patterns in Rust 🦀: An Introduction to the Builder Pattern\". Introduction\nIn this blog article, I want to talk about a design pattern implementation in Rust 🦀: The Builder Pattern. But before we start, let us take the time to understand what design patterns are and why we should use them in our projects.\n\nWha..."
url: "https://hashnode.com/posts/design-patterns-in-rust-an-introduction-to-the-builder-pattern/63d566939de8ed71de21868a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Design Patterns in Rust 🦀: An Introduction to the Builder Pattern](https://blog.ediri.io/design-patterns-in-rust-an-introduction-to-the-builder-pattern?utm_source=hashnode&utm_medium=feed)

Introduction In this blog article, I want to talk about a design pattern implementation in Rust 🦀: The Builder Pattern. But before we start, let us take the time to understand what design patterns are and why we should use them in our projects. Wha...

Jan 28, 2023 · 9 min read · blog.ediri.io  
Updated Feb 24, 2023  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#builder-pattern](https://hashnode.com/tag/builder-pattern)
-   [#developer](https://hashnode.com/tag/developer)
-   [#design](https://hashnode.com/tag/design)

## Written by

[Engin Diri](https://hashnode.com/@ediri)

@ediri · Germany

  
[View profile](https://hashnode.com/@ediri)

Customer Experience Architect @ Pulumi

Cloud Native Pilgrim | Kubernetes Enthusiast | Serverless Believer | Customer Experience Architect @ Pulumi | (he/him) | CK{A,AD} |

## Responses 1

Markdown supported · ⌘↵ to post

[Jason Cheng](https://hashnode.com/@tumtumtree)

[Jan 29, 2023](https://hashnode.com/posts/design-patterns-in-rust-an-introduction-to-the-builder-pattern/63d566939de8ed71de21868a/comment/63d6bce4d6ba08377e9495b8)

Why not just have methods to set auto\_upgrade and node\_pool in KubernetesCluster itself? Is it because we want to keep those fields immutable?

[Engin Diri](https://hashnode.com/@ediri)

[Jan 30, 2023](https://hashnode.com/posts/design-patterns-in-rust-an-introduction-to-the-builder-pattern/63d566939de8ed71de21868a/comment/63d6bce4d6ba08377e9495b8#reply-63d77aebe7c69a3e5b2dc0b2)

No, it's not about immutable fields.

It's all about the way to control the creation process of complex objects with a step by step approach + you isolate the complex construction code from the business logic of the product.

But then, nothing wrong to not(!) us a pattern. If you think your code may not benefit from using a pattern then don't use it.
