Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 167

Comment by Filip Milovanović on Is it a good idea to return a Builder from a Factory?

$
0
0
A builder is already a kind of a factory (a factory doesn't have to be a static class). So, I wouldn't go through a static function, unless your team absolutely insists on that for consistency with other code. You could just use new EmployeeBuilder().build() to create an instance with the default values (this makes sense, but may not be obvious to everyone, so make sure to point this out in the docs and/or documentation comments associated with the builder class).

Viewing all articles
Browse latest Browse all 167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>