Skip to content

bjanderson70/sf-cross-cutting-concerns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

sf-cross-cutting-concerns

Cross cutting concerns for apex code. However, going found I will upkeep via the DX project; which can be found 🌟 here 🌟

See this highlevel blog on this framework.

This code designed to encapsulate common cross-cutting concerns (logging, exception handling, platform events, caching, etc.).Often times cross-cutting concerns are an after-thought; or, hastily injected without any ability to manage or control.This package encapsulates those concerns and provide a mechanism to change/augment. Changing behaviour is a matter of inheritance and specifying choice via custom metadata. See the Wiki for more information.

🌟 Updates - Incorporated Platform Events Consumer/Publisher

Platform Events has been incorporated into this framework (:point_right:merge-pe branch) . The overlap between the two was too much to ignore.

It now includes a section on Platform Events. The work is on-going and will be addressed in conjunction with requests. Currently, the updates for Platform Events includes:

  • Added Summer '19 features AsyncOperationEvent; however, this will tie this the package (merge-pe branch) to minimum version 46.
  • Updates include more data written into the BigObject (i.e. replayids and operation ids) for recovery on a queued high-volume event.
  • The template will be started but will probably not be done before the merge.
  • Incorporate Trigger Handling for Platform Events and CDC. There is a section that can tie in the trigger handling framework
  • Control Event Batching Size (initially via attributes before moving into CMDT)

Caveat

This package utilities a good deal of Object Oriented Principles (OOP) (as outlined in the blog linked). This site provides information around OOP and elements therein. Without having a good Object Oriented base, you may be able to take advantage of the components within the package, but you will not fully realize the underlying benefits/intent.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You will need to have Platform Cache enable; otherwise, caching WILL NOT work. Please note, if you are developing in a Dev Org, there is no caching and those related unit tests will fail. In addition, tests will fail if email deliverability is disabled.

Running the tests

The unit tests have a minimum of 90% code coverage. Tests can be invoked from favortite case tool. In Salesforce Org, navigate to Setup->Apex Classes and run all tests

And coding style tests

All code, files and objects related to Apex Cross-Cutting Concerns are prefixed with 'accc'

Deployment

There are TWO repos now. One is the older version which does not have the Platform Events. The newer one incorporates Platform Events and Change Data Capture (CDC) into the cross-cutting concerns.

Use the button below to install the ALL version (i.e. with Platform Events + Trigger Handler)

Deploy to Salesforce

Use the button below to install the Platform Events version (i.e. plus Platform Events)

Deploy to Salesforce

Apex Docs

If you download CCCDocs directory and navigate to ApexDocumentation directory and bring up index.htm in the browser you will get the JavaDoc-like information. The documentation will also link to the Wiki

Contributing

Please read Contributing for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

version 1.0.1.1

Authors

  • Bill Anderson

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

About

Apex Cross cutting concerns for Salesforce

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages