Skip to content

Commit d178d82

Browse files
authored
Merge branch 'master' into DocumentedNewDomainStructure
2 parents c903ddc + 5422faa commit d178d82

File tree

57 files changed

+1517
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1517
-509
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
(A clear and concise description of what the bug is.)
12+
13+
**To Reproduce**
14+
15+
(Please provide a public github repo with a full SFDX project that demonstrates the problem. If the repro case can be followed with a single example Apex class against a scratch org with just the fflib-apex-common and fflib-apex-mocks project deployed into it, you don't need to provide a github repo)
16+
17+
Steps to reproduce the behavior:
18+
1. Create a scratch org as follows....
19+
2. Run the following Anonymous Apex....
20+
3. See error
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
**Screenshots and text of error observed**
26+
If applicable, add screenshots to help explain your problem. Also, paste the text of the raw error into the issue as well so that it can be found by others via search.
27+
28+
**Version**
29+
Did you try to reproduce the problem against the latest fflib-apex-common code?
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/deploy.and.test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Create a Scratch Org, Push Source and Run Apex Tests
33
on:
44
push:
55
pull_request_target:
6+
workflow_dispatch:
67

78
jobs:
89
build:
@@ -24,6 +25,10 @@ jobs:
2425
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
2526
- run: sfdx force:source:push
2627
- run: sfdx force:apex:test:run -w 5
28+
#Intentionally install the Sample Code after the core AEP Commons test pass succeeds so that we don't deploy anything in Sample Code
29+
#that could mask a test failure. A much more involved solution would've been to do a workflow_dispatch to the samplecode project.
30+
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common-samplecode -p sfdx-source/apex-common-samplecode
31+
- run: sfdx force:apex:test:run -w 5
2732
- name: Destroy scratch org
2833
run: sfdx force:org:delete -p
2934
if: always()

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ IlluminatedCloud/
3737

3838
# SFDX Related
3939
.sfdx/
40+
.sf/
4041
sfdx-source/common-base/main/default/
4142
sfdx-source/untracked/
4243
.execanon
@@ -48,4 +49,4 @@ package-lock.json
4849

4950

5051
sfdx-source/group*
51-
research/
52+
research/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ FFLib Apex Common
66

77
**Dependencies:** Must deploy [ApexMocks](https://github.com/apex-enterprise-patterns/fflib-apex-mocks) before deploying this library
88

9-
<a href="https://githubsfdeploy.herokuapp.com">
9+
<a href="https://githubsfdeploy.herokuapp.com?owner=apex-enterprise-patterns&repo=fflib-apex-common">
1010
<img alt="Deploy to Salesforce"
1111
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png">
1212
</a>
1313

1414
Updates
1515
=======
1616

17+
- **December 2022**, **IMPORTANT CHANGE** - Support for native Apex User Mode was added to the library (see [discussion](https://github.com/apex-enterprise-patterns/fflib-apex-common/discussions/419)). For new projects, the old `enforceCRUD` and `enforceFLS` flags on `fflib_SObjectSelector` should be considered deprecated and the constructors that take `dataAccess` arguments should be used instead. Additionally, the introduction of `fflib_SObjectUnitOfWork.UserModeDML` provides an `IDML` implementation that supports `USER_MODE` or `SYSTEM_MODE`. `fflib_SObjectUnitOfWork.SimpleDML` (the default `IDML` implementation) should be considered deprecated. There are measurable performance benefits to using `SYSTEM_MODE` and `USER_MODE` (Apex CPU usage reduction). Additionally, the use of explicit `USER_MODE` and `SYSTEM_MODE` overrides the `with sharing` and `without sharing` class declaration and makes the expected behavior of DML and SOQL easier to understand.
1718
- **April 2021**, **IMPORTANT CHANGE**, the fflib_SObjectDomain has been split into a domain (fflib_IDomain) and triggerhandler (fflib_ISObjectDomain). This change can impact existing projects, please review [this page](docs/202105-new-domain-structure.md) for more details.
1819
- **April 2020**, **IMPORTANT CHANGE**, the directory format of this project repo was converted to [Salesforce DX Source Format](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_source_file_format.htm). While the GIT commit history was maintained, it is not visible on GitHub. If you need to see the history, either clone the repo and execute `git log --follow` from the command line or refer to this [tag](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/metadata-format-prior-to-dx-source-format-conversion) of the codebase prior to conversion.
1920
- **September 2014**, **IMPORTANT CHANGE**, changes applied to support Dreamforce 2014 advanced presentation, library now provides Application factories for major layers and support for ApexMocks. More details to follow! As a result [ApexMocks](https://github.com/apex-enterprise-patterns/fflib-apex-mocks) must be deployed to the org before deploying this library. The sample application [here](https://github.com/apex-enterprise-patterns/fflib-apex-common-samplecode) has also been updated to demonstrate the new features!
2021
- **July 2014**, **IMPORTANT CHANGE**, prior **23rd July 2014**, both the ``fflib_SObjectDomain.onValidate()`` and ``fflib_SObjectDomain.onValidate(Map<Id, SObject> existingRecords)`` methods where called during an on **after update** trigger event. From this point on the ``onValidate()`` method will only be called during on **after insert**. If you still require the orignal behaviour add the line ``Configuration.enableOldOnUpdateValidateBehaviour();`` into your constructor.
2122
- **June 2014**, New classes providing utilities to support security and dynamic queries, in addition to improvements to existing Apex Enterprise Pattern base classes. Read more [here](http://andyinthecloud.com/2014/06/28/financialforce-apex-common-updates/).
22-
- **June 2014**, Experimental [branch](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/fls-support-experiment) supporting automated FLS checking, see [README](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/fls-support-experiment#expirimental-crud-and-fls-support) for more details.
2323

2424
This Library
2525
============

sfdx-project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
],
88
"namespace": "",
99
"sfdcLoginUrl": "https://login.salesforce.com",
10-
"sourceApiVersion": "51.0"
10+
"sourceApiVersion": "55.0"
1111
}

sfdx-source/apex-common/main/classes/fflib_Application.cls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public virtual class fflib_Application
3434
/**
3535
* Class implements a Unit of Work factory
3636
**/
37-
public virtual class UnitOfWorkFactory
37+
public virtual class UnitOfWorkFactory implements fflib_IUnitOfWorkFactory
3838
{
39-
private List<SObjectType> m_objectTypes;
40-
private fflib_ISObjectUnitOfWork m_mockUow;
39+
protected List<SObjectType> m_objectTypes;
40+
protected fflib_ISObjectUnitOfWork m_mockUow;
4141

4242
/**
4343
* Constructs a Unit Of Work factory
@@ -122,7 +122,7 @@ public virtual class fflib_Application
122122
/**
123123
* Simple Service Factory implementation
124124
**/
125-
public virtual class ServiceFactory
125+
public virtual class ServiceFactory implements fflib_IServiceFactory
126126
{
127127
protected Map<Type, Type> m_serviceInterfaceTypeByServiceImplType;
128128

@@ -178,7 +178,7 @@ public virtual class fflib_Application
178178
/**
179179
* Class implements a Selector class factory
180180
**/
181-
public virtual class SelectorFactory
181+
public virtual class SelectorFactory implements fflib_ISelectorFactory
182182
{
183183
protected Map<SObjectType, Type> m_sObjectBySelectorType;
184184
protected Map<SObjectType, fflib_ISObjectSelector> m_sObjectByMockSelector;
@@ -280,7 +280,7 @@ public virtual class fflib_Application
280280
/**
281281
* Class implements a Domain class factory
282282
**/
283-
public virtual class DomainFactory
283+
public virtual class DomainFactory implements fflib_IDomainFactory
284284
{
285285
protected fflib_Application.SelectorFactory m_selectorFactory;
286286

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>55.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>55.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>55.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

0 commit comments

Comments
 (0)