Archive for category Design Patterns
Tech Interview – Non-recursive Tree Traversal
Posted by Viktor Peller in .NET, Algorithms, Design Patterns, Interview, Refactor on November 4, 2017
In the previous part we extended the database structure and now it supports sub-directories. The algorithm that walks through the directory structure is based on recursive calls. Many times recursion results a nice program structure, but it also has its drawbacks. What if we want to process the data – like files from a directory […]
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. […]
Tech Interview – Refactoring IV – SOLID Refactor
Posted by Viktor Peller in .NET, Design Patterns, Interview, Refactor, SOLID Principles on August 27, 2017
In this part we are going to refactor the parsers and the factory method more, utilizing design patterns and the SOLID principles.
Recent Comments