Comment

Comment by eduardofcgo

Usually with OOP several builders are composed together to express the creation of some data. These builders have functions with types, which define the rules for the creation of the objects.

My point is that the CarBuilder is not a real type that relates to the business, but something that we had to create to encode some behaviour/rules.

Some function that validates that a dict is a valid car is much more explicit that lots of different builder classes in my opinion.

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton