Showing posts with label book. Show all posts
Showing posts with label book. Show all posts

Tuesday, January 26, 2016

Daggerless Dependency Injection for Testing

I have written many articles about using Dagger to inject mocks into tests to remove external dependencies. But many people don't want to use Dagger, for a variety of reasons.

Dependency injection is a design pattern. The libraries are there to help you, but if you prefer you can definitely implement it yourself.

Remember I said I want to write a book on Espresso, but only if there is enough demand? For this particular topic there is definitely a lot of demand, so I went ahead and wrote a primer: Daggerless Dependency Injection for Testing.

It shows you how to how to set up your Android project and implement dependency injection from first principles. You will be refactoring a sample app to learn how to extract dependencies for injection purposes. And of course there are some Espresso tests as well.

Get it here: https://gum.co/DaggerlessDITesting.

Wednesday, April 4, 2012

Book Review: Confessions of a Public Speaker

I got a postcard for a free O'Reilly ebook at some event, and it was sitting on my desk until I read the sample chapter for Confessions of a Public Speaker by Scott Berkun. A good speech is both informative and entertaining, and Scott seems to be able to do both, so I used the postcard to get the ebook.

I finished the book flying from San Francisco to Chicago, on my way to speak at WindyCityGo and Philly ETE. Some of the advice are quite general, like arrive early to get used to the set up, but I picked up quite a few new tricks:

  • The energy of the room, and hence your speech, depends on the density of the crowd, not the number. If there is not enough people to fill the room, gather them to the front and center to make a tight crowd.
  • Set the pace by telling people your outline in the beginning. I used to think this will make the talk boring by killing the surprise element, but then I realized that my surprises usually only span over 2 slides, so a high-level outline shouldn't do any harm. The outline helps people orient themselves, and knowing pace helps people stay focused.
  • Finish early. People who are interested to hear more from you will stay around, the bored ones will move on. Everybody is happy.

I was on chapter 9, and I could sense that the book was going to end soon. But according to my Kindle I was only at 55%. Turns out there was a rather long appendix to the book, with tons of practical tips and funny anecdotes. My favorite part is the diaster stories from various speakers. Someone realized last minute that he was expected to lecture in a language that he does not speak. Someone got a tiny audience because Linus Torvalds was speaking next door. Someone's tie caught on fire. The stories are so funny that I had to suppress my laugh so I won't disturb the guy sitting next to me on the plane.

I love that part because it lets me know that even if my speech goes wrong, worse things can happen. More importantly, the anecdotes reinforce my belief that storytelling is the core of all communications, writing and speaking alike. It's a bit hard to tell stories in a technical talk, so I find myself showing lots of real-life examples to illustrate high-level principles.

I give this book 5 stars out of 5. It's funny and informative, and as an aspiring speaker I am both inspired and educated. Recommended.