Advanced Apex Programming 4th Edition now Available

I’m pleased to announce the immediate availability of the fourth edition of Advanced Apex Programming!

I know what you’re thinking – what has changed? Do I really need a new edition?

Well, the first thing you should know, is that this book is about 20% larger than the previous edition. But, the price is the same – instead of increasing the page count, I was able to increase the page size – from 6 x 9 to 7.5 x 9.25.

And what’s in that 20%?

Here’s a brief summary of the major changes for this edition:

Chapter 2: The section on “Controlling Program Flow” has been largely rewritten with a new example.

Chapter 3: The sections on “CPU Time Limits”, “Benchmarking”, “24-hour Limits” and “Other Platform Limits” are new or have been rewritten.

Chapter 5: There’s a new discussion on detecting duplicate fields in dynamic SOQL queries.

Chapter 6: The trigger framework has been enhanced, with particular attention to handling record DML updates across multiple trigger handlers (a subject discussed in previous editions but not actually demonstrated).

Chapter 7: New coverage of platform events.

Chapter 9 is a completely new topic: Application configuration. The previous chapters 9-12 are now chapter 10-13 and the following paragraphs refer to them by their new chapter number.

Chapter 10: Additional discussion of platform events.

Chapter 11: Revised recommendations for unit tests and managed packages.

Chapter 13: Updated for Salesforce DX

So even if you don’t buy this new edition, please don’t read the previous one – the platform has changed, and many of the earlier recommendations no longer reflect best practices.

And by the way – the Kindle edition is still priced considerably lower than the print edition – so that offers an inexpensive way to check out what’s new without buying a new printed book, for those of you who are more cost sensitive (I do recommend the printed book in general though, as listings just don’t come through that well in the eBook editions).

As always, watch for corrections and updates here on advancedapex.com – as I’m quite sure Salesforce will continue to update the platform faster than I can revise the book 🙂

4 comments to Advanced Apex Programming 4th Edition now Available

  • Eduard

    Hi Dan! Thanks a lot for your book, it’s a great source of knowledge for apex development. I have one question regarding Chapter 9 where you explain how to manage app configuration. In the ConfigController class you don’t actually use the AppCustomSetting wrapper for AppConfig__c. Instead you access them directly in the controller. Why? Earlier in the chapter you wrote that it’s better to access custom settings/metadata via wrappers.

    • Dan

      Great question!
      My intent (which could have been more clear) was that “access” in this context meant – to read and use configuration data in the application overall. Doing so allows you to add intelligence to the configurability, to isolate the application from the underlying configuration objects, and in most cases to prevent outside code from modifying the configuration.
      However, the purpose configuration controller pages is to modify the configuration – they ultimately have to modify and update the underlying object. So this code has (or should have) the intelligence to do any necessary validation. Because its job is to modify the object, there’s little benefit in providing isolation from the object. In fact, it simplifies matters – as the page can easily hold all changes in memory and write the underlying object at once – something harder to do when using a wrapper (that presumably exposes each item as an individual property).
      Now, one could make the argument that it makes sense to put the “write configuration” capability in the wrapper – say, in a scenario where you also provided an external API to modify configuration. But even there I’d lean to keeping it out of the main wrapper and instead creating a configuration writing class to be used both by the API and the controller. Ultimately part of the intent is to tightly control how outside code can modify configuration to ensure it remains valid and provide later flexibility for change.

  • Charles


    I’m a bit confuse about how to go about viewing the sample code in the book. I downloaded the SFDX git repository but I’m not sure how to go about setting things up. I created a scratch org and pushed the repository but I’m not seeing anything. Could you help me with this?

    Very Respectfully,

    Charles T. Green

    • Dan

      Hi Charles:

      The easiest way to set things up is to use the SourceTree application (https://www.sourcetreeapp.com/) and point it to your local repository. You’ll then see branches for each chapter. You can check out each chapter’s code – and push that code into your scratch org. There are many introductions to git (including a trail: https://trailhead.salesforce.com/en/content/learn/modules/git-and-git-hub-basics). I like sourcetree because it is graphical and easy to use.
      I realize that using the code does requires a minimal working knowledge of git – but that working knowledge is, I believe, essential knowledge for every advanced developer in the age of SFDX.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>