Book Image

Real-World Implementation of C# Design Patterns

By : Bruce M. Van Horn II
5 (3)
Book Image

Real-World Implementation of C# Design Patterns

5 (3)
By: Bruce M. Van Horn II

Overview of this book

As a software developer, you need to learn new languages and simultaneously get familiarized with the programming paradigms and methods of leveraging patterns, as both a communications tool and an advantage when designing well-written, easy-to-maintain code. Design patterns, being a collection of best practices, provide the necessary wisdom to help you overcome common sets of challenges in object-oriented design and programming. This practical guide to design patterns helps C# developers put their programming knowledge to work. The book takes a hands-on approach to introducing patterns and anti-patterns, elaborating on 14 patterns along with their real-world implementations. Throughout the book, you'll understand the implementation of each pattern, as well as find out how to successfully implement those patterns in C# code within the context of a real-world project. By the end of this design patterns book, you’ll be able to recognize situations that tempt you to reinvent the wheel, and quickly avoid the time and cost associated with solving common and well-understood problems with battle-tested design patterns.
Table of Contents (16 chapters)
1
Part 1: Introduction to Patterns (Pasta) and Antipatterns (Antipasta)
4
Part 2: Patterns You Need in the Real World
8
Part 3: Designing New Projects Using Patterns

What this book covers

Chapter 1, There’s a Big Ball of Mud on Your Plate of Spaghetti: Before we dive into patterns, let’s dive into why we need them. The world of software development is very messy, but it doesn’t have to be. The mess comes from a set of degenerative forces in our work that you will surely recognize.

Chapter 2, Prepping For Practical Real-World Applications of Patterns in C#: To defeat the degenerative forces mentioned in Chapter 1, you’re going to have to step up your game. This chapter presents some rules and principles. If you can adhere to them, you will have the discipline needed to use design patterns to their greatest effect.

Chapter 3, Getting Creative with Creational Patterns: Now that you are thoroughly prepared, this chapter introduces our story. It covers patterns designed to make the instantiation of your classes more robust and more flexible. After reading this chapter, you’ll never look at the new keyword the same way.

Chapter 4, Fortify Your Code with Structural Patterns: This chapter covers techniques you can use to structure your classes for maximum flexibility while honoring the SOLID principles covered in Chapter 2.

Chapter 5, Wrangling Problem Code by Applying Behavioral Patterns: Got algorithms? You need a flexible set of patterns in order to maximize their effectiveness and flexibility. You need behavioral patterns.

Chapter 6, Step Away from the IDE! Designing with Patterns Before You Code: In this chapter, we consider ways to design our code with patterns before we write a single line in our IDE. After an unfortunate turn of events in our story, we find our company drastically and rapidly changing direction. We need a new product design, and we need it last week! Let’s draw our designs in UML first! This saves a lot of time and energy and prevents the possibility of some pointy-haired boss telling us to ship a prototype.

Chapter 7, Nothing Left but the Typing – Implementing the Wheelchair Project: In the last chapter, we came up with an elegant set of design diagrams. In this chapter, we do the typing. You’ll implement the same patterns you learned earlier in the book, but this time, you’ll use them in concert with each other on a real-world project.

Chapter 8, Now You Know Some Patterns. What Next?: We’ve had a lot of fun learning patterns so far, but this is only the tip of the iceberg. There are patterns everywhere! They aren’t limited to the practice of OOP. In this chapter, we cover the GoF patterns we didn’t cover in our story.

Chapter 9, Appendix 1 – A Brief Review of OOP Principles in C#: This appendix is designed for those who are new to C# or maybe haven’t used it in a while, or are coming from another language.

Chapter 10, Appendix 2 – A Primer on the Unified Modeling Language: The Unified Modeling Language is a documentation convention used by software developers. It defines the structure of the pattern design diagrams used throughout the book. While UML has 14 different diagram types, we really only use class diagrams. Most presentations on patterns have two diagrams. I draw a generic one, and a second diagram that mirrors the project code. This appendix shows you the conventions used in the diagrams.