Refactoring C# Code – Implementing Design Patterns

Half the battle in programming clean code is in the correct implementation and usage of design patterns. Design patterns themselves can become code smells. A design pattern becomes a code smell when it is used to over-engineer something that is rather simple to implement.

You have already seen the use of design patterns in writing clean code and refactoring code smells in the previous chapters of this book. Specifically, we have implemented the adapter pattern, the decorator pattern, and the proxy pattern. These patterns were implemented in the right way to accomplish the task at hand. They were kept simple and they most certainly did not complicate the code. So, when used for their proper ...

Get Clean Code in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.