Salesforce Platform Enterprise Architecture: A must-read guide to help you architect and deliver packaged applications for enterprise needs, 4th Edition
- Length: 712 pages
- Edition: 4
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2023-03-31
- ISBN-10: 1804619779
- ISBN-13: 9781804619773
- Sales Rank: #460923 (See Top 100 Books)
Deliver impressive enterprise-grade applications using the Salesforce Platform with the help of established architectural patterns and best developer practices.
Key Features
- Use the latest capabilities of the Salesforce Platform to code robust apps and web experiences, with an extended focus on Lightning Web Components
- Branch out to Java, Node.js, and other languages with a new chapter exploring app development capabilities using Heroku and Functions
- Extend your application with access to external services following new coverage of OpenAPI enabled API services
Book Description
Salesforce makes architecting enterprise grade applications easy and secure – but you’ll need guidance to leverage its full capabilities and deliver top-notch products for your customers.
This fourth edition brings practical guidance to the table, taking you on a journey through building and shipping enterprise-grade apps.
This guide will teach you advanced application architectural design patterns such as separation of concerns, unit testing, and dependency injection. You’ll also get to grips with Apex and fflib, create scalable services with Java, Node.js, and other languages using Salesforce Functions and Heroku, and find new ways to test Lightning UIs. These key topics, alongside a new chapter on exploring asynchronous processing features, are unique to this edition. You’ll also benefit from an extensive case study based on how the Salesforce Platform delivers solutions.
By the end of this Salesforce book, whether you are looking to publish the next amazing application on AppExchange or build packaged applications for your organization, you will be prepared with the latest innovations on the platform.
What you will learn
- Create and deploy packaged apps for your own business or for AppExchange
- Understand Enterprise Application Architecture patterns
- Customize the mobile and desktop user experience with Lightning Web Components
- Manage large data volumes with asynchronous processing and big data strategies
- Learn how to go beyond the Apex language, and utilize Java and Node.js to scale your skills and code with Heroku and Salesforce Functions
- Test and optimize Salesforce Lightning UIs
- Use Connected Apps, External Services, and Objects along with AWS integration tools to access off platform code and data with your application
Who this book is for
If you are a Salesforce developer who wants to unlock the true potential of the Salesforce platform and deliver complex, scalable applications within your company or for use in large enterprises you target through AppExchange, then you have come to the right place. You will need a solid foundation of Salesforce development to dive into this book – it is here to elevate your skills, not teach you the basics.
Preface Who this book is for What this book covers To get the most out of this book Get in touch Part I: Key Concepts for Application Development Building and Publishing Your Application Introducing Salesforce DX Introducing the new Salesforce Task Driven CLI Required organizations Introducing Salesforce Hyperforce Introducing the book’s sample application Package types and benefits The features and benefits of managed and unlocked packages Creating your first managed package Setting and registering your package namespace Creating the package and assigning it to the namespace Adding components to the package Dependent packages Package platform feature dependencies Release and Beta packages Optional package dependencies Dynamic bindings Dependent packages Supporting package upgradability Managing package ancestry Developing in scratch orgs containing ancestry information Becoming a Salesforce partner and the benefits of doing so Security review and benefits Creating test and demo orgs via the Environment Hub Introduction to AppExchange and listings Installing and testing your package Automating package installation Understanding how to license your package The Licenses tab and managing customer licenses The Feature Parameters tab and managing features The Subscribers tab The Subscriber Overview page How licensing is enforced in the subscriber org Providing support Customer metrics Trialforce and Test Drive Distributing Salesforce Connected Apps Summary Leveraging Platform Features Packaging and upgradable components Custom Fields – picklist values Global picklists Automating upgrade tasks with the Metadata API Understanding Custom Field features Default field values Encrypted fields Special considerations for platform encryption Lookup options, filters, and layouts Rollup summaries and limits Understanding the available security features Functional security Your code and security review considerations Data security Your code and security review considerations Platform APIs Considerations for working well with the platform’s APIs Localization and translation Localization Translation Building customizable user interfaces Layouts Customizing Lightning Components and Visualforce pages Lightning App Builder and Components Email customization with email templates Flow Social features and mobile Creating and testing a new package version Summary Application Storage Mapping out end user storage requirements Understanding the different storage types Data storage Columns versus rows Visualizing your object model Considerations for configuration data File storage Record identification, uniqueness, and auto-numbering Unique and external ID fields Auto Number fields Customizing the Auto Number display format Record relationships Reusing existing Standard Objects Importing and exporting data Salesforce CLI data import and export Salesforce Data import wizard Options for replicating data External data sources Connecting to AWS data sources Creating a new FormulaForce package version Summary Apex Execution and Separation of Concerns Execution contexts Exploring execution contexts Execution context and state Platform Cache Execution context and security Execution context transaction management Apex governors and namespaces Namespaces and governor scope Deterministic and non-deterministic governors Key governors for Apex package developers Where is Apex used? Separation of concerns Apex code evolution Separating concerns in Apex Separation of concerns in Lightning Components Separation of concerns in Lighting Web Components Separation of concerns in Lightning Aura Components Execution context logic versus application logic concerns Improving incremental code reuse Patterns of Enterprise Application Architecture The Service layer The Domain layer The Data Mapper (Selector) layer Introducing the Apex Commons library Unit testing versus system testing Packaging the code Summary Part II: Backend Logic Patterns Application Service Layer Introducing the Service layer pattern Implementation of design guidelines Naming conventions Bulkification Security enforcement Defining and passing data Considerations when using SObject in the Service layer interface Transaction management Compound services A quick guideline checklist Handling DML with the Unit of Work pattern Without a Unit of Work With a Unit of Work The Unit of Work scope Unit Of Work special considerations Services calling services Contract-driven development Testing the Service layer Mocking the Service layer Calling the Service layer From Lightning Web Component Apex controllers From Visualforce Apex controllers From the Apex Scheduler Updating the FormulaForce package Summary Application Domain Layer Introducing the Domain layer pattern Encapsulating an object’s behavior in code Interpreting the Domain layer in Apex Domain classes in Apex compared to other platforms Implementing design guidelines Naming conventions Bulkification Defining and passing data Transaction management Domain class template Implementing Domain trigger logic Routing trigger events to Domain class methods Enforcing security Default behavior of fflib_SObjectDomain Changing the default object security behavior of fflib_SObjectDomain Enabling user mode by default for fflib_SObjectUnitOfWork Apex Trigger event handling Defaulting field values on insert Validation on insert Validation on update Implementing custom Domain logic Object-oriented programming Creating a compliance application framework An Apex interface example Step 5 – Defining a generic service Step 6 – Implementing the Domain class interface Step 7 – The Domain class Factory pattern Step 8 – Implementing a generic service Step 9 – Using the generic service from a generic controller Summarizing the implementation of the compliance framework Testing the Domain layer Unit testing Test Trigger methods using DML and SOQL Test Trigger methods without using DML or SOQL Test methods using the Domain class methods Calling the Domain layer Service layer interactions Domain layer interactions Updating the FormulaForce package Summary Application Selector Layer Introducing the Selector layer pattern Implementing design guidelines Security conventions Naming conventions Bulkification Record order consistency Querying fields consistently with a Selector field contract The Selector class template Implementing the standard query logic Standard features of the Selector base class Enforcing security Default behavior Overriding the default behavior and enabling user mode Knowing when to run SOQL queries in system mode Ordering Field Sets Multi-Currency Implementing custom query logic A basic custom Selector method A custom Selector method with sub-select A custom Selector method with related fields A custom Selector method with a custom dataset Combining Apex data types with SObject types SOSL and aggregate SOQL queries Introducing the Selector factory SelectorFactory methods Writing tests and the Selector layer Updating the FormulaForce package Summary Additional Languages, Compute, and Data Services FormulaForce Web and API requirements Applying Heroku Expanding FormulaForce automation experiences Applying Functions Solution overview Usage of the sample source code included in this chapter Other general considerations Building web experiences with Node.js and Heroku Step 1: Understanding LWR Node.js source files Step 2: Introduction to the Insights LWC and Insights API Step 3: Starting the LWR server locally and editing code Step 4: Deploying the LWR server to Heroku for the first time Step 5: Adding storage for race predictions using Heroku Postgres Step 6: Accessing season data using Heroku Connect Step 7: Accessing partner data using the Salesforce API Step 8: Deploying the website and API to end users Building OpenAPI-enabled APIs with Heroku Step 1: Understanding the API Node.js source files Step 2: Extending the LWR server to support APIs Step 3: Implementing FormulaForce partner authentication Step 4: Introduction to OpenAPI and associating it with API code Step 5: Overview of the Swagger-generated API documentation Extending automation with Java and Salesforce Functions Step 1: Understanding the Java Function source files Step 2: Accessing org data with the Salesforce Functions SDK Step 3: Running and editing the Function locally Step 4: Deploying the Driver Check-in Function Step 5: Invoking a deployed Function from Apex Wrapping Functions and Heroku APIs in Apex Service classes Step 1: Insights API and the Apex Service layer Step 2: Driver Check-in Function and the Apex Service layer Step 3: Exposing the Driver Check-in Function to Flow Summary Part III: Developing the Frontend Building User Interfaces What devices should you target? Leveraging standard and custom UIs Why consider Visualforce over the Lightning Component framework? Lightning Component programming frameworks Leveraging the Salesforce standard UIs and tools Overriding standard Salesforce UI actions Combining standard UIs with custom UIs Embedding a custom UI into a standard UI Reusing Salesforce UI components in a custom UI Extending the Salesforce standard UIs Lightning Components Visualforce pages Generating downloadable content Generating printable content Overriding the UI language Client-server communication Interacting with Apex and data API governors and availability Database transaction scope and client calls Managing limits Object and field level security Enforcing security in LWC Enforcing security in Visualforce Managing performance and response times Lightning tools to monitor size and response times Using the Service layer and database access Considerations for client-side logic and Service layer logic Considerations for using third-party JavaScript libraries Custom Publisher Actions Creating websites and communities Mobile applications Custom report UIs and the Analytics API Updating the FormulaForce package Summary User Interfaces and the Lightning Component Framework Building a basic standalone Lightning page Introduction to the Lightning Design System Building your first component How does Lightning differ from other UI frameworks? Lightning architecture Containers Introducing the Race Overview Lightning app Lightning Experience and Salesforce Mobile Components Separation of concerns Encapsulation during development Enforcing encapsulation and security at runtime Expressing behavior Platform namespaces Base components Data Service Object-oriented programming Object-level and field-level security FormulaForce Lightning Components RaceStandings component RaceCalendar component RaceResults component RaceSetup component Making components customizable Integrating with Lightning Experience Using components on Lightning Pages and Tabs Integrating with Lightning Flow Integrating with Lightning Communities Exposing components with Lightning Out Updating the FormulaForce package Summary Part IV: Extending, Scaling, and Testing an Application Providing Integration and Extensibility Reviewing your integration and extensibility needs Defining the Developer X persona Understanding and managing versioning Versioning the API definition Versioning the API definition of the Salesforce APIs Versioning the API functionality Translation and localization Terminology and platform alignment What are your integration use cases? Developer X calling your APIs on-platform Developer X calling your APIs off-platform Developer X calling your APIs asynchronously through Platform Events What are your application’s extensibility use cases? Standard platform APIs for integration An Apex-callable interface API Application integration APIs Providing Apex application APIs Calling an Apex application API from Apex Modifying and deprecating the Apex application APIs Versioning Apex application API definitions Providing RESTful application APIs Key aspects of being RESTful What are your application resources? Mapping HTTP methods Providing Apex REST application APIs Calling your Apex REST application APIs Versioning Apex REST application APIs Behavior versioning Definition versioning Exposing Platform Events Exposing Lightning Components Extending Flow Versioning invocable methods Extending application logic with platform extensibility features Extending application logic with Apex interfaces Extending application logic with Flow The MuleSoft platform Summary Asynchronous Processing and Big Data Volumes Creating an object for race data Using Apex to generate synthetic race data Indexes, being selective, and query optimization Standard and custom indexes Ensuring queries leverage indexes Factors affecting the use of indexes Profiling queries Skinny tables Handling large result sets Processing 50k maximum result sets in Apex Processing unlimited result sets in Apex Processing unlimited result sets using the Salesforce APIs Handling billions of records with Big Objects Salesforce and NoSQL stores Using a Big Object for race lap history Importing Big Object data Using Data Loader to import data into a Big Object Options to query Big Object data Synchronous Big Object SOQL queries Asynchronous Big Object SOQL queries Asynchronous processing Asynchronous user experience design considerations Asynchronous processing with workers and jobs Implementing a worker with @future Implementing a worker with Queueables Implementing a job with Batch Apex Asynchronous processing with Platform Events Using high-scale Platform Events to stream data ingestion Using Change Data Capture Platform Events to compute data Sending race data telemetry events through the Salesforce DX CLI Asynchronous processing with Functions Volume testing Summary Unit Testing Comparing unit testing and integration testing The testing pyramid on the Salesforce Platform Introducing unit testing Introduction to unit testing with Apex Deciding what to test for and what not to test for in a unit test Constructor dependency injection Implementing unit tests with CDI and mocking Other dependency injection approaches Benefits of dependency injection frameworks Writing unit tests with the Apex Stub API Implementing mock classes using Test.StubProvider Creating dynamic stubs for mocking classes Considerations when using the Apex Stub API Using the Apex Stub API with mocking frameworks Understanding how ApexMocks works ApexMocks matchers ApexMocks and Apex Enterprise Patterns Unit testing a controller method Unit testing a Service method Unit testing a Domain method Unit testing a Selector method Unit testing with Lightning Web Components Introduction to unit testing with Lightning Web Components Validating that the driver list is correctly bound to the table Validating that the selected drivers are sent to the server Unit testing with Salesforce Functions Integration testing Flow and user interface logic Flow testing UTAM testing overview Summary Source Control and Continuous Integration Development workflow and infrastructure Creating and preparing your scratch orgs Understanding the developer workflow Developing with source control Populating your source control repository Deploying the code from source control Developing in scratch orgs with a namespace Leveraging the Salesforce REST APIs from the Salesforce CLI and custom plugins Updating your source control repository Controlling what gets pulled down locally from your org Managing local files and committing to source control Hooking up continuous integration Using continuous integration to maintain code health Introducing the Jenkinsfile for CI Installing, configuring, and testing a Jenkins CI server Exploring Jenkins and CI further Releasing from source control Automated regression testing Alternative Salesforce-oriented CI/CD servers Summary Integrating with External Services Understanding inbound and outbound integrations Managing inbound integrations Introducing Salesforce Connected Apps A Node.js application using a Connected App Understanding options for outbound integrations Managing outbound connections with Named Credentials Calling outbound connections from Apex Using per-user Named Credentials Accessing external API services via External Services Accessing external data seamlessly via External Objects Integration with AWS Services Summary Adding AI with Einstein Understanding Salesforce Einstein services and products Understanding Einstein Prediction Builder Understanding Einstein Discovery Discovering insights from Formula 1 race results Understanding Einstein Platform Services Summary Other Books You May Enjoy Index
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Salesforce Platform Enterprise Architecture: A must-read guide to help you architect and deliver packaged applications for enterprise needs, 4th Edition
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.