A couple of years ago, I wrote that The #Builderpattern is a finite #statemachine! A state machine consists of states and transitions between them. As a developer, I want to make illegal states unrepresentable, i.e., users of my API can’t create non-existent transitions. My hypothesis is that only a static typing system allows this at compile-time. Dynamic typing systems rely on runtime validation.

In this blog post, I will show that it holds true, with a caveat.

https://blog.frankel.ch/illegal-state-unrepresentable/

Making illegal state unrepresentable

A couple of years ago, I wrote that The Builder pattern is a finite state machine!. A state machine consists of states and transitions between them. As a developer, I want to make illegal states unrepresentable, i.e., users of my API can’t create non-existent transitions. My hypothesis is that only a static typing system allows this at compile-time. Dynamic typing systems rely on runtime validation. In this blog post, I will show that it holds true, with a caveat.

A Java geek

Mẫu Builder giúp tạo các đối tượng phức tạp một cách dễ dàng và có cấu trúc, tránh rối rắm khi có nhiều tham số tùy chọn. Bài viết này khám phá mẫu Builder thông qua ví dụ "Đặt Pizza Tùy Chỉnh", trình bày cả phương pháp cổ điển và hiện đại, sử dụng mã tương thích Java 21.

#designpattern #builderpattern #laptrinh #thietkethuattoan

https://www.reddit.com/r/programming/comments/1nhf754/a_comprehensive_guide_on_builder_design_pattern/

🚀 Just shipped PHP Builder Generator 1.0.0!

Stop writing manual builder boilerplate. Just add #[Builder] and get fluent, type-safe builders generated.
✅ Zero runtime overhead
✅ Full IDE support
✅ Modern PHP 8.2+

Try: composer require --dev maxbeckers/php-builder-generator

🔗 https://github.com/maxbeckers/php-builder-generator

#PHP #OpenSource #CodeGeneration #BuilderPattern

GitHub - maxbeckers/php-builder-generator: Generate builder patterns for PHP classes using attributes.

Generate builder patterns for PHP classes using attributes. - maxbeckers/php-builder-generator

GitHub

Ja klar, liebe #Java-Typen!

Lasst mich komplexe Objekte immer im #BuilderPattern aufbauen!

Wer braucht schon IDE-Unterstützung die mir sagt welche Eigenschaften noch gesetzt werden müssen, wenn man auch 100x den Compiler und Tests laufen lassen kann, bis alle NullPointerExceptions dann irgendwann gelöst sind?

/s