Archive for September, 2017
Expression Tree Based Activators
Posted by Viktor Peller in .NET, Refactor on September 23, 2017
In the previous part, in the convention based factory, we used the Activator class CreateInstance() method to create a parser dynamically using a type information. This solution works well in our example, but there is a faster way to create class instances than using Activator.
Tech Interview – Refactoring V – Convention Based Factory
Posted by Viktor Peller in .NET, Design Patterns, Interview, Refactor, SOLID Principles on September 10, 2017
In the previous part we fixed the code which reads the Person instances from the datafiles. A part of this code was a Factory class based on a switch statement. This solution is ok, but when we add a new parser, we need to remember to add a new case block to the switch statement. […]
Recent Comments