Skip to content

Commit cc16cf3

Browse files
Merge branch 'master' into DocumentedNewDomainStructure
2 parents d178d82 + e011569 commit cc16cf3

File tree

47 files changed

+375
-187
lines changed

Some content is hidden

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

47 files changed

+375
-187
lines changed

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

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,33 @@ jobs:
1515
with:
1616
ref: ${{github.event.pull_request.head.ref}}
1717
repository: ${{github.event.pull_request.head.repo.full_name}}
18-
- name: Install SFDX CLI and authorize DevHub
19-
uses: apex-enterprise-patterns/setup-sfdx@v1 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
18+
- name: Install SF CLI and authorize DevHub
19+
uses: apex-enterprise-patterns/setup-sfdx@v2 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
2020
with:
2121
sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}
22-
- run: sfdx force:config:set defaultdevhubusername=SFDX-ENV -g #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
23-
- run: echo y | sfdx plugins:install shane-sfdx-plugins
24-
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
25-
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
26-
- run: sfdx force:source:push
27-
- 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
22+
# - name: Install the required plugins
23+
# run: echo y | sf plugins install shane-sfdx-plugins
24+
- name: Setup the config parameters needed
25+
run: sf config set target-dev-hub SFDX-ENV --global #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
26+
- name: Create the scratch org
27+
run: sf org create scratch --definition-file config/project-scratch-def.json --set-default --duration-days 1 --no-track-source --alias fflibapexcommon
28+
# - name: Install required dependency frameworks
29+
# run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-mocks --path sfdx-source/apex-mocks
30+
- name: Clone fflib-apex-mocks repo
31+
run: mkdir temp && git clone https://github.com/apex-enterprise-patterns/fflib-apex-mocks.git "temp/fflib-apex-mocks"
32+
- name: Deploy and compile the fflib-apex-mocks codebase
33+
run: cd temp/fflib-apex-mocks && sf project deploy start --ignore-conflicts --target-org fflibapexcommon && cd ../..
34+
- name: Deploy and compile the codebase
35+
run: sf project deploy start
36+
- name: Run the core framework tests
37+
run: sf apex run test --wait 5
38+
# Intentionally install the Sample Code after the core AEP Commons test pass succeeds so that we don't deploy anything in Sample Code
39+
# that could mask a test failure. A much more involved solution would've been to do a workflow_dispatch to the samplecode project.
40+
- name: Install sample code project to verify with
41+
# run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-common-samplecode --path sfdx-source/apex-common-samplecode
42+
run: git clone https://github.com/apex-enterprise-patterns/fflib-apex-common-samplecode.git "temp/fflib-apex-common-samplecode" && cd temp/fflib-apex-common-samplecode && sf project deploy start --ignore-conflicts --target-org fflibapexcommon && cd ../..
43+
- name: Run the core framework tests and the sample code project tests
44+
run: sf apex run test --wait 5
3245
- name: Destroy scratch org
33-
run: sfdx force:org:delete -p
46+
run: sf org delete scratch --no-prompt
3447
if: always()
35-
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Manage SF API Versions
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
api-version:
6+
description: 'api version in the format XX e.g 58'
7+
required: true
8+
type: string
9+
jobs:
10+
update:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: apex-enterprise-patterns/[email protected]
15+
with:
16+
api-version: ${{inputs.api-version}}
17+
- uses: peter-evans/create-pull-request@v5
18+
with:
19+
title: 'Bump API Versions to ${{inputs.api-version}}.0'
20+
body: 'Automatically bumped by GitHub Actions '
21+
branch: 'devops/bump-api-versions-v${{inputs.api-version}}.0'
22+
commit-message: 'chore: bump api to v${{inputs.api-version}}.0'

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ Application Enterprise Patterns on Force.com
3333

3434
Design patterns are an invaluable tool for developers and architects looking to build enterprise solutions. Here are presented some tried and tested enterprise application engineering patterns that have been used in other platforms and languages. We will discuss and illustrate how patterns such as Data Mapper, Service Layer, Unit of Work and of course Model View Controller can be applied to Force.com. Applying these patterns can help manage governed resources (such as DML) better, encourage better separation-of-concerns in your logic and enforce Force.com coding best practices.
3535

36-
Dreamforce Session and Slides
37-
-----------------------------
38-
39-
- View slides for the **Dreamforce 2013** session [here](https://docs.google.com/file/d/0B6brfGow3cD8RVVYc1dCX2s0S1E/edit)
40-
- Video recording of the **Dreamforce 2013** session [here](http://www.youtube.com/watch?v=qlq46AEAlLI).
41-
- Video recording of the **Advanced Apex Enterprise Dreamforce 2014** session [here](http://dreamforce.vidyard.com/watch/7QtP2628KmtXfmiwI-7B1w%20).
42-
- View slides for the **Dreamforce 2015** session [here](http://www.slideshare.net/andyinthecloud/building-strong-foundations-apex-enterprise-patterns)
43-
4436
Documentation
4537
-------------
4638

@@ -53,11 +45,19 @@ Documentation
5345
- [Apex Enterprise Patterns - Service Layer](http://wiki.developerforce.com/page/Apex_Enterprise_Patterns_-_Service_Layer)
5446
- [Apex Enterprise Patterns - Domain Layer](http://wiki.developerforce.com/page/Apex_Enterprise_Patterns_-_Domain_Layer)
5547
- [Apex Enterprise Patterns - Selector Layer](https://github.com/financialforcedev/df12-apex-enterprise-patterns#data-mapper-selector)
48+
- View slides for the **Dreamforce 2013** session [here](https://docs.google.com/file/d/0B6brfGow3cD8RVVYc1dCX2s0S1E/edit)
49+
- View slides for the **Dreamforce 2015** session [here](http://www.slideshare.net/andyinthecloud/building-strong-foundations-apex-enterprise-patterns)
50+
51+
**Related Webinars**
52+
- [Advanced Apex Enterprise Patterns](https://www.youtube.com/watch?v=BLXp0ZP0cF0)
53+
- [Apex Hours (August 2020): Apex Enterprise Patterns](https://www.apexhours.com/apex-enterprise-patterns/)
54+
55+
**Related Book**
56+
- [Salesforce Platform Enterprise Architecture, 4th Edition, by Andrew Fawcett](https://www.amazon.com/Salesforce-Platform-Enterprise-Architecture-applications-ebook/dp/B0BD8TBT75/)
5657

5758
**Other Related Blogs**
5859

5960
- [Preview of Advanced Apex Patterns Session (Application Factory and ApexMocks Features)](http://andyinthecloud.com/2014/08/26/preview-of-advanced-apex-enterprise-patterns-session/)
6061
- [Unit Testing with the Domain Layer](http://andyinthecloud.com/2014/03/23/unit-testing-with-the-domain-layer/)
61-
- [MavensMate Templates](http://andyinthecloud.com/2014/05/23/mavensmate-templates-and-apex-enterprise-patterns/)
6262
- [FinancialForce Apex Common Updates](http://andyinthecloud.com/2014/06/28/financialforce-apex-common-updates/)
6363

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"orgName": "apex-common",
3+
"edition": "Developer",
4+
"features": [
5+
"MultiCurrency"
6+
],
7+
"settings": {
8+
"currencySettings":{
9+
"enableMultiCurrency": true
10+
},
11+
"lightningExperienceSettings": {
12+
"enableS1DesktopEnabled": true
13+
}
14+
}
15+
}

sfdx-project.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"packageDirectories": [
3-
{
4-
"path": "sfdx-source/apex-common",
5-
"default": true
6-
}
7-
],
8-
"namespace": "",
9-
"sfdcLoginUrl": "https://login.salesforce.com",
10-
"sourceApiVersion": "55.0"
11-
}
2+
"packageDirectories": [
3+
{
4+
"path": "sfdx-source/apex-common",
5+
"default": true
6+
}
7+
],
8+
"namespace": "",
9+
"sfdcLoginUrl": "https://login.salesforce.com",
10+
"sourceApiVersion": "63.0"
11+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public virtual class fflib_Application
8686
* if set via the setMock method
8787
*
8888
* @remark If mock is set, the list of SObjectType in the mock could be different
89-
* then the list of SObjectType specified in this method call
89+
* than the list of SObjectType specified in this method call
9090
**/
9191
public virtual fflib_ISObjectUnitOfWork newInstance(List<SObjectType> objectTypes)
9292
{
@@ -102,7 +102,7 @@ public virtual class fflib_Application
102102
* if set via the setMock method
103103
*
104104
* @remark If mock is set, the list of SObjectType in the mock could be different
105-
* then the list of SObjectType specified in this method call
105+
* than the list of SObjectType specified in this method call
106106
**/
107107
public virtual fflib_ISObjectUnitOfWork newInstance(List<SObjectType> objectTypes, fflib_SObjectUnitOfWork.IDML dml)
108108
{
@@ -139,7 +139,7 @@ public virtual class fflib_Application
139139
* Note that this will not check the Apex Classes given actually implement the interfaces
140140
* as this information is not presently available via the Apex runtime
141141
*
142-
* @param serviceInterfaceTypeByServiceImplType Map ofi interfaces to classes
142+
* @param serviceInterfaceTypeByServiceImplType Map of interfaces to classes
143143
**/
144144
public ServiceFactory(Map<Type, Type> serviceInterfaceTypeByServiceImplType)
145145
{
@@ -189,11 +189,11 @@ public virtual class fflib_Application
189189
public SelectorFactory() { }
190190

191191
/**
192-
* Consturcts a Selector Factory linking SObjectType's with Apex Classes implement the fflib_ISObjectSelector interface
192+
* Constructs a Selector Factory linking SObjectType's with Apex Classes implement the fflib_ISObjectSelector interface
193193
* Note that the factory does not check the given Apex Classes implement the interface
194194
* currently this is not possible in Apex.
195195
*
196-
* @Param sObjectBySelectorType Map of SObjectType's to Selector Apex Classes
196+
* @param sObjectBySelectorType Map of SObjectType's to Selector Apex Classes
197197
**/
198198
public SelectorFactory(Map<SObjectType, Type> sObjectBySelectorType)
199199
{
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>55.0</apiVersion>
3+
<apiVersion>63.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>55.0</apiVersion>
3+
<apiVersion>63.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>55.0</apiVersion>
3+
<apiVersion>63.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>63.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

0 commit comments

Comments
 (0)