
Desertcart purchases this item on your behalf and handles shipping, customs, and support to UAE.
This book covers Dependency Injection from A to Z. In it you'll learn about Constructor Injection, Property Injection, and Method Injection. You'll learn about the right and wrong way to use the Dependency Injection Container. Review: Buy - Nick has good books and this one is no exception Review: Great Book for Flexible, Solid Code! - This book goes through great practical examples to decouple your hardbound code. By climbing the ladder from tightly couple code to using interfaces and then a dependency injection container, one can achieve much more flexible and maintainable code. For example, these techniques make test driven development much easier by first writing an interface with mock code and then substituting real code behind the same interface. Unless you're already using these techniques, this book will (or at least should) change the way you code and provide patterns to assist you. The one thing it doesn't do is rewrite your old code. :-)
| Best Sellers Rank | 1,642,712 in Books ( See Top 100 in Books ) |
| Customer Reviews | 4.4 out of 5 stars 21 Reviews |
E**S
Buy
Nick has good books and this one is no exception
S**D
Great Book for Flexible, Solid Code!
This book goes through great practical examples to decouple your hardbound code. By climbing the ladder from tightly couple code to using interfaces and then a dependency injection container, one can achieve much more flexible and maintainable code. For example, these techniques make test driven development much easier by first writing an interface with mock code and then substituting real code behind the same interface. Unless you're already using these techniques, this book will (or at least should) change the way you code and provide patterns to assist you. The one thing it doesn't do is rewrite your old code. :-)
M**P
Never late to improve your Delphi skills
Thanks to Mr. Hodges I think that my code will be better.
B**E
Five Stars
Great price for a solid book.
G**N
I wish it was a bit clearer and better edited
My 3-star rating is the average of a 5-star and a one star rating. Five stars for the author's stalwart advocacy for good software practices, and a fair number of useful suggestions. But as a book it lacks a number of qualities that would have been useful. On the mundane level, there's no index, and no chapter numbers. More significantly, there seems to have been minimal vetting as to whether the intended readers would find the material presented in a sequence that answers the questions that would arise along the way. For example, in the Dependency Injection Container chapter, the first section is "What is a Dependency Injection Container?" which completely avoids telling us what it is, instead focusing on what it is not -- none of which will make sense to a reader who doesn't already have some idea of what a DI container is. Guess what the next section is? "What is the Container?". I think it's very helpful to discuss what a thing is not, to dispel misunderstandings, but only after the reader has a good grasp of what it IS and has been introduced to the vocabulary in which the "what it's not" discussion will be phrased. This entire chapter ends with "That's the basics of the Container." Except it isn't -- all that's been covered is how to register interfaces and classes into the container. No concrete discussion, nor code, explaining what on earth the container does for us, except for a brief mention that at the beginning of our code we're supposed to call the Container to "resolve" the entire object graph for the application, whatever that means. This does all become clearer in subsequent chapters, except that it leaves open the gnawing question -- "wait, surely applications (especially GUI apps) need to construct (and destroy) additional branches of objects later than just at the beginning?" (setting aside the actual VCL or FMX classes that have their own management). Yet there is much advocacy (and simple examples) of doing it only at the beginning. Maybe I missed something, but I don't see how to extrapolate those examples to real applications. But there might be hope in the GUI FileViewer example which ends the book. Here the code shows that the DI Container is created in the FormCreate, and not at the beginning of the application. Ah-HAH! Maybe this is where we learn that actually multiple separate DI Containers can and should be used more locally, so that the lifetimes of the objects they manage can parallel whatever else is going on the app -- here the lifetime of a form (albeit that in this demo there is only one form, so that lifecycle is almost the same as the app.). But here we run aground because the code fails to even show where the DI Container is populated! And there is no commentary on this striking deviation from the book's categorical statements like "you should use the Container once and only once at the composite (composition?) root of your application... I assure you it can be done". Suspecting a bug in the code, perhaps we can go look into the downloadable sample code. There we find (after considerable hassle getting Atlassian's SourceTree to work, no fault of this book, of course) at least three separate copies of the code (in multiple versions, in a version-control sense). There is one that does complete the book's code, and at least confirmed my suspicion of what was missing. There are two other versions that use the DI Container in ways that the book says are not correct. (The author does mention he's changed his views on a couple of principles -- it would be helpful if the repo had a conspicuous README_DelphiDependencyInjection file pointing to the correctest code.) Bottom line: I am glad this book exists for Delphi, especially given that no doubt the sales for this kind of title do not lead quickly to retirement in luxury. It appears that much of the advice parallels what one might find in other DI or Spring books, but it's nice that the book confirms that it can be done in Delphi, with Spring4D. I just wish there had been the time to take a bit more care with having it all make sense with a bit less struggle.
Trustpilot
1 month ago
2 weeks ago