Jump to ratings and reviews
Rate this book

Adaptive Code Via C#: Agile Coding with Design Patterns and Solid Principles

Rate this book
Your process may be agile, but are you building agility directly into the code base? This book teaches .NET programmers how to give code the flexibility to adapt to changing requirements and customer demands by applying cutting-edge techniques, including SOLID principles, design patterns, and other industry best practices.




Understand why composition is preferable to inheritance and how flexible the interface really can be Gain deep knowledge of key design patterns and anti-patterns, when to apply them, and how to give their code agility Bridge the gap between the theory behind SOLID principles, design patterns, and industry best practices by pragmatically solving real-world problems Get code samples written in upcoming version of Microsoft Visual C# Topics include: Agile with Scrum process; dependencies and layering; the interface; patterns and anti-patterns; introduction to SOLID principles, including open/closed and dependency interjection; and using application templates

432 pages, Paperback

First published February 22, 2014

172 people are currently reading
608 people want to read

About the author

Gary McLean

5 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
198 (52%)
4 stars
129 (34%)
3 stars
40 (10%)
2 stars
6 (1%)
1 star
1 (<1%)
Displaying 1 - 29 of 29 reviews
Profile Image for Aelena.
65 reviews18 followers
June 9, 2017
Excellent book. Wish I had found a book like this 10 years earlier. Even seasoned devs or architects will find here concepts and ideas they did not know before or hadn't understand with the necessary clarity. That is precisely one of the virtues of the book. Simple, clear, concise and precise language, with no unwarranted jargon o verbosity. Make sure you get a copy for yourself and a few copies for your younger and more eager devs.
Profile Image for Jorge Castro.
2 reviews1 follower
July 25, 2020
In a nutshell, 🥜Enlightening book ⚡

Gary takes us in a journey through the seas of patterns and practices that helps us build quality software because it means with them we can write adaptable, maintainable, testable and even, readable code, go figure! We all could use some of that.

He explains with enough deepness, behavioral and architectural patterns (and anti-patterns) and demystifies SOLID principles to achieve all of this, and explains what Test Driven Development is all about and how to leverage it to write quality tests which leads to less technical debt.

At the end, he shows how to put all things together with Dependency Injection. And also some guidance of metrics like Coupling, Cohesion, and Connascence, which I wish we could get more of it, because I believe the more we measure, the better we can see progress in our performance.

He even dedicates and entire part of the book to Agile and Kanban because without proper execution, simply there is little you can do as developer when projects struggle to find proper management of work items, that however may deserve a deeper understanding and overall, practice, that more often than not, is not in control of the developers, but is our responsibility we are ready to use them and to encourage the use of proper Agile practices.

It is all about how we deliver value and with how much quality.

Read my full review at my blog
Profile Image for Denis Nuțiu.
62 reviews5 followers
October 27, 2021
I have been programming for over 5 years and I thought that I know what the Liskov Substitution Principle means, this book made it clear that I did not know LSP rules :))

It's a great read for anyone willing to learn some design patterns, clean code rules and the SOLID advice.
Profile Image for Cezary Piątek.
10 reviews1 follower
September 17, 2020
As I remember the chapter about the D from SOLID covers Dependency Injection instead of Dependency Inversion (those are two totally different things)
51 reviews1 follower
December 28, 2024
Five stars with some minor misgivings.

This is one of the best "big picture" tech books I've ever gone through as for WHY you want to do something (which is sadly missing in most tech books as they opt for the HOW to do something, usually poorly at that). It's amazing how relevant and accurate it is years after its release.

While this would be a fantastic recommendation for a junior programmer, I really don't think they'd really understand most of it, but the exposure alone would be good for them. This is best suited for a mid level dev looking to take first steps to make the jump to senior or a senior dev looking for a refresher or to fill some gaps in their knowledge.

The main things I'd like to see in a 3rd edition:
1) Remove the scrum/kanban chapters. These are absolutely unrelated to the rest of the book and can easily be skipped.
2) I'd like to see the use of consistent examples throughout each chapter, rather than a bunch of little examples.
3) Double check the code in the examples. Ex: Lots of interfaces shown as not requiring parameters when the actual implementation does.
4) Replace all Unity references with something else (the built in IoC in .NET Core would probably be fine).
Profile Image for Christian Oleson.
15 reviews2 followers
August 23, 2020
As a Developer, I am always looking at ways of improving my code. This book is a great extension to Uncle Bob’s (Robert Martin’s) books in Clean Code and Clean Architecture. Martin, a native Java developer, writes all of his examples in Java, while this book covers examples in C#, making the read a little more intuitive to C# devs.

Whether a C# dev or not, this book should be read by anyone who is looking to develop code that is extensible and well designed. It teaches the SOLID principles in depth, while showing design patterns that enable each SOLID principle. On top of this, it breaks down TDD, Scrum, Kanban, Definition of Done, and more.

If I were a manager or lead developer in a enterprise, this would be a book I would buy for my entire team. A team who abuses by the principles in the book are destined for success in an agile world.
1 review
April 4, 2021
The "Adaptive Code" and "Agile coding" words caught my eyes. Design and write "maintainable, readable, and tested" code that is adaptive to change is not easy work and I found this book helps me a lot.
This book summarizes many popular techniques like dependencies and layering management, abstraction design with interfaces, test-driven development, refactoring, and SOLID principles. The book is easy to read and understand. I like the author's writing style.
Profile Image for Tom Jones.
106 reviews16 followers
April 10, 2018
Highly recommended.

I've been using C# for a while (My first Programming language) and learned new things and concepts about the language.

For someone who's looking into a career as a software developer primarily using C#, it was very helpful. Useful for both beginners who wish to learn the language and someone like myself.

5 stars from me.
Profile Image for Yura Terletskyi.
1 review
June 23, 2019
Best software design book I have read so far. It was a clue - a breaking book for me.
Profile Image for Matt Gregory.
12 reviews1 follower
July 30, 2020
Fantastic. Written by an excellent writer. Learn this stuff. Or die.
Profile Image for Bengt.
10 reviews
June 14, 2021
I think it was a great book specifically for the thought process around concrete examples regarding DI and SOLID code.

29 reviews
March 16, 2024
Pretty good explanations of solid principles and dependency injection
Profile Image for Pawel.
6 reviews
May 12, 2018
It's the best programming book I've read for a long time. When I was reading it there were so many new and fascinating things that I felt like Neo in Matrix learning whole Kung Fu in just a few minutes.

Just a few examples of the things I learned (and there were many, many others):
-I already knew to favor composition over inheritance but I learned why
-why using "new" keyword is (in many cases) bad
-how to create more readable/declarative tests using the builder pattern
-2 separate types of TDD: purist and pragmatic
-to focus more on MTTR (Mean Time To Recovery) than on MTBF (Mean Time Before Failure)
-I gained a much deeper understanding of SOLID principles
-what is the purpose of exceptions ;)

I recommend this book to any developer:
-for junior devs it will be very dense with knowledge and may require to be read a few times
-for mid-level devs (like me) it will be very rewarding
-for senior devs it may be a great refresher and a summary of the knowledge
Profile Image for Dan Dexter.
5 reviews
November 13, 2014
What caught my attention about Adaptive Code Via C# is that it combined Agile methodologies, design patterns, and SOLID Principles into one book and this was made readily apparent by the subtitle. When I came across this book, I was more interested in the SOLID Principles part as I’ve had a decent amount of experience working on Agile teams, and had a copy of the well-received Design Patterns book by the Gang Of Four, which I was certain that I wouldn’t learn anything new from Adaptive Code Via C# and that it would just be the same material. I was wrong. What I found while reading this book is that the author describes the Agile methodology in a way that is refreshing even if you’ve been on Agile teams before. I was also pleasantly surprised at how well the author described some design patterns in a way that wasn’t overly technical, but instead in a way that is more conversational and in easily digestible chunks.

The book does a good job of marrying the topics of Agile, design patterns, and SOLID together by describing the relationship between them and how they complement one another. The author starts off with an overview of Agile, the need for adaptive code in order to adapt to rapidly changing requirements, and the importance of managing dependencies and creating a layered architecture such that the overall architecture is structured in a way that promotes adaptability. As part of the same section, he also talks about design patterns and several in particular that lend themselves nicely to adaptive code. From there, the author then describes the SOLID Principles, what they are, what they mean, and how following the principles helps create code that is easily extendable and easily unit tested. I was aware of the SOLID Principles in theory, but this book included a lot of example code both before and after each principle was applied that really drove home just how valuable these principles can be when applied correctly. Lastly, the book finishes with a simulated Agile project that steps you through a couple of simulated sprints on a project, the dialogue the developers have, and how the design patterns and SOLID Principles are applied in a way that makes future additions much easier to integrate into the system.

Overall this book was very well written, fun to read, and I highly recommend it. If you’re not experienced with C# much, I wouldn’t let that prevent you from getting the book, a lot of the knowledge is easily applied to other languages. The author states that the target audience for this book is intermediate level developers, which I don’t necessarily disagree with, but I could see junior engineers learning a lot from this book provided that they are at a point that they at least have cursory understanding of design patterns and separation of logic. The piece on Agile is also a great refresher for those who have experience with it, but I imagine it is a valuable read for those who are new to the methodology.
228 reviews6 followers
September 6, 2016
This book is a great read for C# developers. Depending on your level of experience, you may find it either highly informative if you're a mid-level developer or use it as a great reference book if you're an experienced developer.

The book starts with Scrum basics. It was reviving to read about the overall process. There are some crucial design strategies that are described in part 1 of the book.

The chapter about Unit testing and refactoring in part 1 was very convincing as well. The explanation of TDD was quite detailed and in an easy-to-understand language.

Part II is dedicated to SOLID principles and their implementation. Each of these chapters are as in-depth as one can get. I have not read a better explanation of Liskow substitution principle anywhere else. I finally understand that principle.

Part III narrates a team discussion on how SCRUM and SOLID principles come together. It was done in a very 'story'-ish way so it was nice to read through that conversation.

There's an introduction about Git in the Appendix and if you're new to Git this will be a nice overview to get started with.
Profile Image for Aleksandar Ilioski.
18 reviews
April 23, 2020
Definitely one of the top 5 programming books that I have ever read. It gives such a clear overview of how the process of software development should go.

It starts with Agile and Scrum introduction, goes over the code smells and mistakes that are made often by developers, and tells you in detail how to avoid traps, improve code, and refactor towards scalable and maintainable codebase.

The most interesting part goes through the SOLID principles.

I can't say that some part of the book was more valuable than others. For me, this book, combined with the "Design Patterns" classic from GoF was the next step in my career as a software developer.

The one and the only regret I have is not purchasing this book 4-5 years ago.
Have in mind that this is a type of book that one has to read at least a few times. Going through it once, no matter how focused you are will not make you get the most out of it. The second pass will discover and unveil different things.
Profile Image for Dovilė Skiriūtė.
8 reviews1 follower
February 22, 2021
Excellent book for those who are interested to SOLID principles and how they implement in practice with design patterns, what anti-patterns need to avoid. SOLID principles are concentrated wisdom for decades of research and they don’t use any tools. It is just principles. Design patterns helps to implement these principles in practice. So, the gap between theory and practice is filled in his book. It is dedicated for an experienced programmers. In order to understand everything clearly, I would highly recommend to read additional sources parallely. I prefer to choose the second edition (2017).
Profile Image for C. Graves.
2 reviews
November 22, 2015
This is an excellent resource for learning about the SOLID principles.

The book begins with an overview of Scrum, unit testing and refactoring.

Next it gives excellent explanations for each of the principles. I was very happy with these chapters which were well formatted, easy to understand and a joy to read.

Finally the book concludes with samples that follow a team of developers through the agile process. These felt genuine, and helped reinforce the material.

Great book for developers interested in making their future selves lives easier.
4 reviews
October 18, 2017
No book made clear the solid principles as well as this. I can not recommend this highly enough. I am seriously considering reading the new revision that has recently been published. It is extremely concise, not verbose at all (unlike some software development books that attempt to be far too intelligent diluting the intended message) and the examples are brilliant.

Any developer can learn from this, from beginner to senior. Simplicity is the ultimate sophistication.
Profile Image for Ben Rand.
335 reviews7 followers
August 31, 2015
A really concise overview of several important programming concepts. Many of the main topics here (Dependency Injection, Patterns) have entire books dedicated to those topics so this is either a good starting point or good review. The best thing about the book, IMO, is how it glues together a lot of these concepts.
2 reviews
September 21, 2016
The book covers a big deal of best principles and practices of OOP development. As an experienced .NET developer, I found a few things new to me, though most of the material I already knew. As a whole the book was of a little value to me. I think it is most valuable for junior developers.
1 review1 follower
June 2, 2016
Great tips for leveraging best practices and patterns. Very simple to understand.
Profile Image for Artem Valieiev.
1 review1 follower
October 10, 2016
I suggest this book everyone who are going to work in team. It's covers basics of scrum process and management, with fundamentals of design practices in C# and solid Principles.
Displaying 1 - 29 of 29 reviews

Can't find what you're looking for?

Get help and learn more about the design.