Yearly archives: 2018

20 posts

C++ The Modern Factory

I think I have architected, designed and implemented, what might be a (bit) better  Factory Pattern. Of course, I am pretty sure someone else has discovered the same variation.

Of all the patterns, very often, I was particularly bothered with “classical” aka legacy, Factory. Yes, once implemented, you can relatively easily make it create new “things”, but on the design and usability level, to me,  it does not look very flexible and expandable.

On the C++ level, it requires code repetition and the use of smart pointers. In essence, these two combined, somehow do not look to me like modern C++ at all. Continue reading