Tag

object construction

1 views collected around this technical thread.

Python Programming Learning Circle
Python Programming Learning Circle
May 21, 2025 · Fundamentals

Why Defining __init__ Directly Is a Bad Practice and How to Replace It with dataclasses, classmethods, and NewType

The article explains that using a custom __init__ method to create data structures couples object construction with side‑effects, leading to fragile code, and demonstrates how refactoring with @dataclass, @classmethod factories and typing.NewType yields cleaner, safer, and more testable Python classes.

Pythonclassmethoddataclasses
0 likes · 13 min read
Why Defining __init__ Directly Is a Bad Practice and How to Replace It with dataclasses, classmethods, and NewType
Cognitive Technology Team
Cognitive Technology Team
Mar 21, 2022 · Backend Development

Using the Builder Pattern to Manage Multiple Constructor Parameters in Java

The article explains how the Builder pattern helps simplify object creation when a class has many required and optional parameters, using Java's HttpClient and HttpRequest examples to demonstrate fluent configuration and reduce constructor overloads.

Builder PatternHttpClientJava
0 likes · 2 min read
Using the Builder Pattern to Manage Multiple Constructor Parameters in Java
Architect's Tech Stack
Architect's Tech Stack
Jan 20, 2021 · Fundamentals

Using a Generic Builder Pattern in Java to Simplify Object Creation

This article demonstrates how a universal Builder utility can replace verbose object construction in Java, allowing developers to instantiate a class and set multiple properties—including complex collections—in a single fluent chain, while also explaining the underlying implementation and usage examples.

Builder PatternFluent APIJava
0 likes · 7 min read
Using a Generic Builder Pattern in Java to Simplify Object Creation