Luke Church watched the API usability presentation and contacted me with a question about a point I made regarding the factory design pattern and usability.
One thing that I probably didn’t make clear in the presentation is that the difficulties with the factory design pattern are greatest for opportunistic programmers (or programmers working in an opportunistic style). There are three reasons why these programmers have difficulties with the factory design pattern:
For these same reasons, other types of programmers have fewer difficulties with the factory design pattern. The pragmatic programmers are similar to opportunistic programmers (certainly in terms of point 1 above) but the difference is that when they discover that the type they want to create does not expose a constructor they expand their code focus and narrow their task focus as well as start to consider reasons why the type does not expose a constructor. Thus they are likely to end up finding the factory that lets them create the instance of that type.
Systematic programmers approach the task differently and, having a much wider code focus to begin with will be more likely to assume or to learn that type instances are created by a factory before they get started writing code.