Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Salesforce Platform Enterprise Architecture- fourth edition

You're reading from   Salesforce Platform Enterprise Architecture- fourth edition A must-read guide to help you architect and deliver packaged applications for enterprise needs

Arrow left icon
Product type Paperback
Published in Mar 2023
Publisher Packt
ISBN-13 9781804619773
Length 712 pages
Edition 4th Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Andrew Fawcett Andrew Fawcett
Author Profile Icon Andrew Fawcett
Andrew Fawcett
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part I: Key Concepts for Application Development
2. Building and Publishing Your Application FREE CHAPTER 3. Leveraging Platform Features 4. Application Storage 5. Apex Execution and Separation of Concerns 6. Part II: Backend Logic Patterns
7. Application Service Layer 8. Application Domain Layer 9. Application Selector Layer 10. Additional Languages, Compute, and Data Services 11. Part III: Developing the Frontend
12. Building User Interfaces 13. User Interfaces and the Lightning Component Framework 14. Part IV: Extending, Scaling, and Testing an Application
15. Providing Integration and Extensibility 16. Asynchronous Processing and Big Data Volumes 17. Unit Testing 18. Source Control and Continuous Integration 19. Integrating with External Services 20. Adding AI with Einstein 21. Other Books You May Enjoy
22. Index

Implementing custom query logic

Take a look at the implementation of the selectSObjectsById base class method we have used so far in this chapter. The following buildQuerySObjectById method code gives us an indication of how we implement custom Selector methods; it also highlights the newQueryFactory base class method usage:

public List<SObject> selectSObjectsById(Set<Id> idSet) { 
  return Database.query(buildQuerySObjectById()); 
} 
private String buildQuerySObjectById() { 
  return newQueryFactory(). 
           setCondition('id in :idSet'). 
           toSOQL(); 
} 

The newQueryFactory method exposes an alternative object-oriented way to express a SOQL query. It follows the fluent design model with its methods, making code less verbose. For more information on this approach, see https://en.wikipedia.org/wiki/Fluent_interface.

The instance of fflib_QueryFactory returned by this method is preconfigured with the object, fields, sort order, and any...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image