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
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 2. Leveraging Platform Features FREE CHAPTER 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

Extending the application logic with Apex Interfaces

An Apex Interface can be used to describe a point in your application logic where custom code written by Developer X can be called. For example, in order to provide an alterative means to calculate championship points driven by Developer X, we might expose a global interface describing an application callout that looks like this:

global class ContestantService{global interface IAwardChampionshipPoints
  {
    void calculate(List<Contestant__c> contestants);
  }
}

We can then reference a custom setting (the Application setting has been included in the source code for this chapter) to determine whether Developer X has provided an implementation of this interface to call instead of the standard calculation code. The following code uses the Type.forName methods to construct at runtime the Apex type and create an instance of the type that can be cast to the interface.

Notice how the code supports Developer X providing a class name that...

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