Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Force.com Enterprise Architecture

You're reading from   Force.com Enterprise Architecture Blend industry best practices to architect and deliver packaged Force.com applications that cater to enterprise business needs

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher
ISBN-13 9781782172994
Length 402 pages
Edition 1st 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 (13) Chapters Close

Preface 1. Building, Publishing, and Supporting Your Application FREE CHAPTER 2. Leveraging Platform Features 3. Application Storage 4. Apex Execution and Separation of Concerns 5. Application Service Layer 6. Application Domain Layer 7. Application Selector Layer 8. User Interface 9. Providing Integration and Extensibility 10. Asynchronous Processing and Big Data Volumes 11. Source Control and Continuous Integration Index

The Selector class template


A Selector class such as the Domain class utilizes inheritance to gain some standard functionality, in this case, the base class delivered through the FinancialForce.com Enterprise Apex Patterns library, fflib_SObjectSelector.

A basic example is as follows:

public class RacesSelector extends fflib_SObjectSelector
{
   public List<Schema.SObjectField> getSObjectFieldList()
   {
     return new List<Schema.SObjectField> {
        Race__c.Id,
        Race__c.Name,
        Race__c.Status__c,
        Race__c.Season__c,
        Race__c.FastestLapBy__c,
        Race__c.PollPositionLapTime__c,
        Race__c.TotalDNFs__c };
   }

   public Schema.SObjectType getSObjectType()
   {
      return Race__c.sObjectType;
   }
}

Tip

The base class uses Dynamic SOQL to implement the features described in this chapter. One potential disadvantage this can bring is that references to the fields are made without the Apex compiler knowing about them, and as such, when you...

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