Thursday, April 28, 2016

New Salesforce Book - Apex Design Patterns


 

I'm really excited to share that today my book (co-written with Jitendra Zaa) has been published. Here are some personal insights

A little history
This particular topic was always in my head and coming from .Net background and having worked with lots of design patterns in MS development world. I first successfully used Factory design pattern with Apex in 2009, when all my team was scratching their head and (cursing me badly) for "overtly complicating" the code architecture. They were happy with creating 20-30 different VF pages, which I emphasized needs to be designed with the help of 4-5 VF pages, VF components and factory method pattern. Well, we were able to complete the whole stuff in time and deliver it flawlessly. It was then and similar instances later that I realized that a larger faction of Salesforce developers (back then) had very less knowledge about design patterns and code architecture. There was a huge gap.

Over the years a lot of bloggers have shared so much valuable content that the gap has almost diminished now. It was during conversation between Jitendra and myself that we realized that we should address this area and try to share some more details.

About the Book (also included in book)
The first and obvious challenge we faced was the presence of lots of highly informative and relevant blogs and books out there addressing design patterns. Largely, the information is out there. But, we realized that most of the content is primarily Java centric and it is very hard for a non-seasoned Java programmer to understand the nomenclature of design patterns. Furthermore, most of the example scenarios are also very alien to Salesforce development.

So, we created content keeping Salesforce developers in mind. The content was supposed to be very easy to understand and the all scenarios were to be Salesforce related. We spent so many hours debating on minute things, to ensure that any reader reading this book will be able to grasp and hold on to the knowledge (it's the latter part which has been the biggest challenge with design patterns).

Writing Experience
Well, all I can say is that it was not easy. All these months (around 7-8) we were in constant pressure to stick to timelines. So, we divided some patterns amongst ourselves. Then came Dreamforce '15 and we got really occupied with it. After Dreamforce '15, we completed first draft of all chapters and shared. All this while we both were working in silos and interacting on need basis.

BAAM!! came the review, and let's just say it was not that bad (as I expected) and not that good either (I very well expected that). So, we sat down together and realized that we got to dedicate lot of quality time together on this, if we have to deliver this. So, we did. We spent lots of nights and weekends on phone calls (2-7 hrs in a day) and reviewed each and every sentence. It'll not be wrong to say that we almost re-wrote entire content again.

Lastly
At the end it was definitely a very tough journey. But, as they say "No Pain, No Gain". However, painful it was to write and review content at 3AM in morning, it given immense satisfaction to learn that I was able to contribute towards greater purpose of sharing knowledge amongst community.

Sincere thanks to Jitendra(co-author) for his dedication and support. Thanks to John(reviewer) for his impeccable reviews. I'm sure he would have recovered well after reviewing our first draft (pun intended).

I really hope that every reader will be able to understand and adapt to the usage of more and more design patterns or rather structured code architecture. Feel free to share your comments with Jitendra and myself.

Popular Posts