Let's take the following Javascript, but the language is not really relevant:
module.exports = (user) => {
return {
createPrimaryConfig: () => {
return new Config('a', 'b', user.getName());
},
createAlternativeConfig: () => {
return new Config('a', 'b', user.getName());
}
}
}
The idea being here that different configurations for a given object can be created (the job of a factory traditionally?) and in most cases, systems will reuse some of these but we want the business logic of deciding how the configuration is built (from the user object) hidden away. If the buisness logic was more complicated, it would be more worthwhile but this simple is contrived and exaggerated a bit.
Is this still a factory method? If not, what would you call it? Does a factory method have to strictly have one method that returns an output? What is it you let the caller select the type it wants?