

Agile coding with design patterns and SOLID principles As every developer knows, requirements are subject to change. But when you build adaptability into your code, you can respond to change more easily and avoid disruptive rework. Focusing on Agile programming, this book describes the best practices, principles, and patterns that enable you to create flexible, adaptive code--and deliver better business value. Expert guidance to bridge the gap between theory and practice Get grounded in Scrum: artifacts, roles, metrics, phases Organize and manage architectural dependencies Review best practices for patterns and anti-patterns Master SOLID principles: single-responsibility, open/closed, Liskov substitution Manage the versatility of interfaces for adaptive code Perform unit testing and refactoring in tandem See how delegation and abstraction impact code adaptability Learn best ways to implement dependency interjection Apply what you learn to a pragmatic, agile coding project Get code samples at: http://github.com/garymclean/AdaptiveCode Review: Required reading for all professional C# developers - Holy cow. This is essential reading for every professional C# developer who works in Agile-Scrum teams, or who wants to. In fact I think this should be required reading for every professional C# developer. I dare say perhaps employers should filter their candidates based on whether they have already read this book. Ultimately this book boils down everything that every company that has been tinkering with Agile or formally using Agile has been most consistently using as its set of core guidelines for project management and SOLID principles as its core set of coding guidelines. It summarizes the software industry's most popular "best practices". This book will teach you at a high level how software in an Agile (Scrum/XP) environment is managed. It will teach you how the code architecture is or should be layered. It will teach you how to write testable code. Ultimately it will teach you how to write code that can adapt to changes--changes including late-discovered new features, realization of bad design, reprioritization of themes, replaced team members, and so on. Every project has changes. This book doesn't teach agile code. It teaches agile *coding*, the process of writing adaptive code, which goes beyond the code itself, and should be embraced by an entire team, otherwise only portions of the concepts are usable. This is true of any agile development book. Mind you, this book also reinforces the *basic* formulation of formal software engineering patterns and practices in the 2000s (now mid-2010s). I have seen teams exercise these "best practices" when their budget or skillset did not afford it. Agile code requires up front investment for long-term savings and sanity. For small projects, if up-front investment cannot be afforded at all but for a quick-and-dirty prototype, management may favor the easier implementation and deployment--the shameful but functional prototype working in production. Personally I think such outputs are occasionally appropriate, as long as they are formally recognized as serious technical debt. I've seen projects go both ways--formal projects abandoning all Scrum/XP (or in some cases any) project management methodologies and unit tests and ending up with a mess of hardly maintainable code, and informal projects going hardcore TDD but missing too many Scrum-XP components and ultimately they never get built--mini-projects that perhaps should never have been formalized with Agile-Scrum, because to do it successfully requires that everyone on board understands the value of every part of the process. But there are still a huge number of excellent habits the quick-and-dirty cowboy developer can still pick up by reading from this book and exercising much of what it suggests. One can still maximize code quality and adaptability following some basic conventions, and these conventions introduce a little extra cost but, exercised conservatively, the immediate tangible benefits outweigh the costs even for the quick-and-dirty prototypes. In such cases, while the entirety of this book is not useful, much of it still is. But this book runs the gamut of development in professional team environments, so it's a good read on the whole because every developer's career goes through what every project must go through: changes in his career. Be prepared. I've come across a few books produced in the previous decade that took too long to explain the principles or were otherwise so completely dry that I honestly could not read them. Gary McLean Hall writes very readable text. It is concise without being distractingly dry and doesn't litter the book with overzealous humor to keep it interesting as it doesn't need to. It is, simply, pointed yet approachable. There are plenty of examples in the book to demonstrate or illustrate his points. And he is surprisingly complete in combining SOLID principles and Agile project methodologies into one book. I'm still surprised by how thick this book *isn't*. It doesn't waste a lot of time. There's a lot to learn. And I'm still reading it; this review will be updated when I'm done, but these are my first impressions. Review: Take your code to the next level - I highly recommend this book. It’s not for the absolute beginner, but if you’re an intermediate or even senior programmer I think you’ll find this book very helpful. The book starts with a summary of Scrum, and I think it makes a good quick reference. For a more in-depth description of Scrum, see the book Scrum: The Art of Doing Twice the Work in Half the Time, which I also recommend (I actually listened to the audiobook). The chapter on dependencies and layering was an excellent discussion on organizing projects in Visual Studio solutions. The idea is to minimize dependencies between your code and external APIs. This helps to untangle your code and keep its components isolated, which makes it easier to maintain them. I applied this concept to one of my projects and I immediately saw the benefits. The book has a chapter on unit testing, but it’s more of a refresher. If you really want to understand unit testing well, read The Art of Unit Testing and Growing Object-Oriented Software, Guided by Tests. Also, I much prefer using NUnit and NSubstitute as my unit testing and mocking frameworks. The book uses MSTest and Moq. The second part of the book discusses the SOLID principles. Each principle gets its own chapter, so it’s quite detailed. What I really like about these chapters is that the author doesn’t stop at theory or simply tell you what your code should look like. He actually goes through relevant examples and shows you how to make your code follow the SOLID principles. The decorator pattern described in the chapter on the single responsibility principle was a huge eye-opener. I’ve known about this pattern before, but the way that he uses it to make code more adaptive is something I hadn’t seen before. It elevates interfaces as major players in your code. The third and final part of the book contains chapters that go through a couple of iterations of a sample project. The characters in these chapters use Scrum to plan the project and use the adaptive patterns in the book to develop it. It felt realistic and it was entertaining, and it helped to remind me of the practices recommended in the book. There wasn’t much that I disliked about the book, but one thing stands out. A lot of the examples (and even the sample project) focused on ASP.NET MVC development. Being a desktop app developer, I’m more interested in WPF and MVVM. He mentions them a few times, but only to say that the same principles as MVC apply to them. I don’t think they do. WPF and MVVM focus on data-binding, which make view models much more dynamic than the static view models in an ASP.NET MVC application. In summary, this book will help you in becoming a better developer. Your code will go from being a big ball of mud to clean code that is adaptive to change.
| Best Sellers Rank | #1,833,676 in Books ( See Top 100 in Books ) #151 in Microsoft C & C++ Windows Programming #207 in Microsoft .NET #236 in C# Programming (Books) |
| Customer Reviews | 4.4 out of 5 stars 193 Reviews |
J**S
Required reading for all professional C# developers
Holy cow. This is essential reading for every professional C# developer who works in Agile-Scrum teams, or who wants to. In fact I think this should be required reading for every professional C# developer. I dare say perhaps employers should filter their candidates based on whether they have already read this book. Ultimately this book boils down everything that every company that has been tinkering with Agile or formally using Agile has been most consistently using as its set of core guidelines for project management and SOLID principles as its core set of coding guidelines. It summarizes the software industry's most popular "best practices". This book will teach you at a high level how software in an Agile (Scrum/XP) environment is managed. It will teach you how the code architecture is or should be layered. It will teach you how to write testable code. Ultimately it will teach you how to write code that can adapt to changes--changes including late-discovered new features, realization of bad design, reprioritization of themes, replaced team members, and so on. Every project has changes. This book doesn't teach agile code. It teaches agile *coding*, the process of writing adaptive code, which goes beyond the code itself, and should be embraced by an entire team, otherwise only portions of the concepts are usable. This is true of any agile development book. Mind you, this book also reinforces the *basic* formulation of formal software engineering patterns and practices in the 2000s (now mid-2010s). I have seen teams exercise these "best practices" when their budget or skillset did not afford it. Agile code requires up front investment for long-term savings and sanity. For small projects, if up-front investment cannot be afforded at all but for a quick-and-dirty prototype, management may favor the easier implementation and deployment--the shameful but functional prototype working in production. Personally I think such outputs are occasionally appropriate, as long as they are formally recognized as serious technical debt. I've seen projects go both ways--formal projects abandoning all Scrum/XP (or in some cases any) project management methodologies and unit tests and ending up with a mess of hardly maintainable code, and informal projects going hardcore TDD but missing too many Scrum-XP components and ultimately they never get built--mini-projects that perhaps should never have been formalized with Agile-Scrum, because to do it successfully requires that everyone on board understands the value of every part of the process. But there are still a huge number of excellent habits the quick-and-dirty cowboy developer can still pick up by reading from this book and exercising much of what it suggests. One can still maximize code quality and adaptability following some basic conventions, and these conventions introduce a little extra cost but, exercised conservatively, the immediate tangible benefits outweigh the costs even for the quick-and-dirty prototypes. In such cases, while the entirety of this book is not useful, much of it still is. But this book runs the gamut of development in professional team environments, so it's a good read on the whole because every developer's career goes through what every project must go through: changes in his career. Be prepared. I've come across a few books produced in the previous decade that took too long to explain the principles or were otherwise so completely dry that I honestly could not read them. Gary McLean Hall writes very readable text. It is concise without being distractingly dry and doesn't litter the book with overzealous humor to keep it interesting as it doesn't need to. It is, simply, pointed yet approachable. There are plenty of examples in the book to demonstrate or illustrate his points. And he is surprisingly complete in combining SOLID principles and Agile project methodologies into one book. I'm still surprised by how thick this book *isn't*. It doesn't waste a lot of time. There's a lot to learn. And I'm still reading it; this review will be updated when I'm done, but these are my first impressions.
C**N
Take your code to the next level
I highly recommend this book. It’s not for the absolute beginner, but if you’re an intermediate or even senior programmer I think you’ll find this book very helpful. The book starts with a summary of Scrum, and I think it makes a good quick reference. For a more in-depth description of Scrum, see the book Scrum: The Art of Doing Twice the Work in Half the Time, which I also recommend (I actually listened to the audiobook). The chapter on dependencies and layering was an excellent discussion on organizing projects in Visual Studio solutions. The idea is to minimize dependencies between your code and external APIs. This helps to untangle your code and keep its components isolated, which makes it easier to maintain them. I applied this concept to one of my projects and I immediately saw the benefits. The book has a chapter on unit testing, but it’s more of a refresher. If you really want to understand unit testing well, read The Art of Unit Testing and Growing Object-Oriented Software, Guided by Tests. Also, I much prefer using NUnit and NSubstitute as my unit testing and mocking frameworks. The book uses MSTest and Moq. The second part of the book discusses the SOLID principles. Each principle gets its own chapter, so it’s quite detailed. What I really like about these chapters is that the author doesn’t stop at theory or simply tell you what your code should look like. He actually goes through relevant examples and shows you how to make your code follow the SOLID principles. The decorator pattern described in the chapter on the single responsibility principle was a huge eye-opener. I’ve known about this pattern before, but the way that he uses it to make code more adaptive is something I hadn’t seen before. It elevates interfaces as major players in your code. The third and final part of the book contains chapters that go through a couple of iterations of a sample project. The characters in these chapters use Scrum to plan the project and use the adaptive patterns in the book to develop it. It felt realistic and it was entertaining, and it helped to remind me of the practices recommended in the book. There wasn’t much that I disliked about the book, but one thing stands out. A lot of the examples (and even the sample project) focused on ASP.NET MVC development. Being a desktop app developer, I’m more interested in WPF and MVVM. He mentions them a few times, but only to say that the same principles as MVC apply to them. I don’t think they do. WPF and MVVM focus on data-binding, which make view models much more dynamic than the static view models in an ASP.NET MVC application. In summary, this book will help you in becoming a better developer. Your code will go from being a big ball of mud to clean code that is adaptive to change.
A**N
Four Stars
Great book. Informative. Good for developer who are moving to a more senior role.
T**N
Great for the intermediate .NET programmer.
This book... Okay, first let me give a little bit of my background so that you will know whether or not this book is for you. First of all, I do not have a formal computer science degree. I do have a degree in electrical/computer engineering, but not computer science. I have had a few formal classes in object-oriented design, data structures and algorithms, operating systems, and an elective in web programming. As far as my experience goes, I have about 1 years of professional software development experience with .NET and C#. I knew nothing about SOLID or TDD at the time I started reading the book. I actually didn't even know what an interface was, but did know that I needed to improve my software design skills. On the back of the book it actually says "Not for beginner programmers... for experienced developers", but I would still consider myself a beginner with C#. Maybe Gary just explains things so well, and makes the concepts easy to understand. Now, for the review. I have skipped the first chapter which is about SCRUM and some project management concepts I am not interested in right now. That being said, I am about 70 pages in and wow... I've had my eyes opened up to the way that software is supposed to be done. The second chapter of the book (where I started) talks about the basics of layering patterns and managing dependencies through simple interfaces. I immediately started finding examples that I could go and apply at work. That's the great thing about this book, Gary will explain a concept, and is right there with an example to show you how its done. How exactly did this book help me? I was able to design some interfaces (not previously knowing what they were) using some of Gary's patterns and I have a much better way of managing my libraries/dependencies now. Gary's formula for describing the different problems in software, and then explaining/giving examples on how to handle them makes this a great buy! I will update this review if things change as I continue into the book.
P**R
I like the variety of topics covered and I think the ...
I like the variety of topics covered and I think the author does a good job describing the principles, even if there are some factual errors as noted by other reviewers. However, I find the code examples to be extremely frustrating to work with. They are disjointed and full of spelling errors and missing project references which means it often won't compile. In fact, the code is so disjointed that the author has to provide a separate PDF explaining which listings match which solutions - and even that is full of errors and is missing an entire chapter leaving you guessing. Starting each chapter with a base solution and then walking through the steps to incorporate each principle would have been ideal; instead we get a snapshot of these changes taken at seemingly random points during the process and we're left guessing how he got there.
S**L
Beautiful book. A must read.
There are certain books that teach new technologies and then there are certain books that will change the way a person thinks until that time. For the later category, DI by Seeman, Design Patterns by GoF, etc., and this book fall into that category. I had one programming style (resulting code nothing but a big pile of mud) until I read this book. A game changer. There are some comments from experienced developers that there were coding errors in this book. Even then, for a beginner to an intermediate programmer, this book is a must-read if the programmer does not know SOLID principles. There are also some comments about the lack of necessity regarding 1st section of the book, covering Scrum. This is debatable. I thought that it laid a foundation quickly why Adaptive Coding to an Agile environment is required.
A**R
Excellent book on modern software engineering.
This book is one of the best I've read on software engineering. Well written and using the latest ideas on SOLID engineering with great examples. A must read for object originated programmers in any language.
M**S
Very Good Practical Demonstration Of S.O.L.I.D. Coding
A separate chapter is devoted to each of the S.O.L.I.D. principals. Each of those chapters contains practical examples that demonstrate their importance in creating code that is adaptable to change. There is also an excellent chapter on controlling dependencies and an introductory chapter on SCRUM. I found the book very helpful. My major complaint about the book would be the organization of the source code examples from GIT. It was difficult to determine which Visual Studio project applied to the book examples. A naming convention of Ch05-2, though imperfect, would have been better.
T**M
Excellent book for C# programmers interested in applying SOLID principals in an Agile environment.
After about 10 years of commercial programming I started to learn about SOLID design principals (and old set of principles from the eighties), it radically changed the way I code and the way I teach the programmers I manage. Therefore I was extremely eager when I saw this book available for pre-order. I purchased it on the day it was released and read it within 2 days. It is clear, concise and extremely practical. The role playing chapter at the end ties together everything you learn throughout the book - and the accompanying C# code that shows how SOLID patterns can be written into your code - along with showing you how to review C# code and spot anti-patterns is priceless. Thanks to the authors for getting this book right. I have read so many SOLID books which have failed to bridge the gap between theory and practical application, this one nails it! As an added bonus I learned a bit more about Agile development (the bits we've fallen short of in the past), for which I am very grateful.
M**C
Really good book.
The book is a warm recomendation. Author uses clear and concise way of presenting the main OOP concepts starting from the bad written code and then introducing the changes that lead to a proper OOP code. That is exactly what is missing in a number of other sources that are dealing with the same topic - lack of bad to right code transition. The only way for someone who writes bad code to start writing the proper code is to show him why his code is bad and then propose improvements. Otherwise he can not understand what problems in his old code will be solved by the new code. Chepters covering Unit testing and dependency Injection are my favourite. I also like the way how covariance and contravariance are clearified during the discussion about Liskov Substitution Principle.. Although I find this book very good and helpful, I have one complaint though. I didn't like the way how author presented Composite pattern describing it as "specialized Decorator pattern". I pretty much disagree with that. Maybe opposite would be more correct since the Decorator can be seen as a special case of Composite when the number of components is 1. However, the chellenges that those two patterns are dealing with are completely different so putting them in a relation is wrong. Decorator pattern gives the solution to the problem of how to change the behavior of one component. Composite deals with the problem of how to treat the individual object and group of individual objects uniformly. Same has been described in GOF Desing Patterns book where Composite is presented first and Decorator afterwards saying that the Decorator can be seen as "degenerate composite" but with remark that Decorator adds additional responsibilities to the component which is the crucial difference between those two patterns and reason why one can not be treated as specialization of another. Looking forward to more books from the same author :)
S**L
Its a fast paced thriller...
This is a book that refreshes you of all the good concepts that you might have forgotten as you got into "Rapid Application Development" mode in .Net and into agile methodology. This books make you stop, rethink, makes you apply all the good practices to your code and still do it the agile way. SOLID concepts are explained well. No chapter is too exhaustive to be boring or too short to not to understand. It is a perfect book that can be read over in a weekend..Yeah, I said weekend. Despite its ~400 pages, it goes at such a speed that you will be able to complete it in a day or two. A must read for anyone doing agile development and C#.
G**S
Five Stars
The future!
T**A
Un très bon livre que tout développeur devrais lire
J'ai trouver ce livre très agréable à lire, j'ai appris énormément de chose que l'on apprend pas sur les banc de l'école ! Il m'a permis de découvrir de nouveau pattern et également de comprendre mieux l'utilité de certain déjà vu. J'ai également aimé l'approche de l'auteur de ne pas vendre les principes SOLID comme "la solution miracle", mais comme des principes à connaitre pour pouvoir les utiliser dans les situations adéquates. Ce que je pourrais peut être reprocher au bouquin et que certains exemples parfois complexifie encore plus le sujet abordé. Pour les francophones comme moi, le livre est en anglais mais est accessible ( quelques recherches google pour les certains proverbes américains on été nécessaire ) Je suis curieux de savoir ce qu'apporte la deuxième édition de ce bouquin...
Trustpilot
2 months ago
2 months ago