faif / python-patterns

A collection of design patterns/idioms in Python
40.2k stars 6.93k forks source link

what's the difference betwen builder.py and abstruct_factory.py #384

Closed SeekPoint closed 2 years ago

faif commented 2 years ago

They are two different ways of creating objects. A builder typically creates a complex object in multiple steps, and until the final build/create function is executed the object is incomplete (in the example builder.py, that's the building object)

SeekPoint commented 2 years ago

@faif Thanks

Maybe you can write a little more like what's the difference btw those pattern, and where and how to utilize it in different scnerio