Re:A FactoryFactoryFactory in Production
by nitrogen on Monday December 18, 2017 @05:17PM
(#15956024)
If Java had default parameters and named parameters I think a ton of the need for Builders and Factories would go away.
I can't, but if you're the FNG on a project and see SprocketFactoryFactoryFactory, you may have a quick and easy path to a better solution. Just make sure that that better solution names its patterns well so the next FNG can make your code even better.
Human short-term memory only has a size limit of about 4 simultaneous chunks so once you're juggling those levels of indirection any development is going to be glacially slow until you've acquired a great deal of experience with the codebase.
Out of interest, can you describe a concrete case where multiple levels of factory patterns have actually been justified and resulted in simpler code than an alternative?