Comments (4)
Amit, I think you basically have two choices; put the fflib code into a library package that all of your other packages will depend on, or duplicate the fflib code in each of your managed packages.
The first approach would require you to fork the code-base for you needs. You'd have to convert the classes / methods to have global visibility, so they can be called from your other managed packages. There are some pros and some cons to this approach. Since you've forked the original code base, it would be more difficult to take advantage of improvements to the original code. Also, once you've declared a class or method signature as "global" it is locked into the package's interface, and cannot be removed or changed. However, having the code in a managed package would allow you to update it in one place and deploy updates with package upgrades.
The second approach would be to include the fflib classes in each of your managed packages that will use it. This will allow you to use the code pretty much as-is, without having to change the class / method visibility, since the code will live within your packages' namespace. You will not have to worry about class namespace collisions. fflib is NOT a package namespace. If your package name is "MyPackage" the fflib classes would be named MyPackage.fflib_SObjectUnitOfWork, etc. Obviously the disadvantage is that you have duplicate copies of the fflib classes within all of your packages. Hope this helps you to make your decision.
from fflib-apex-common.
@tfuda ,
thanks for the quick response. I understand the risk of forking and maintaining separate repo to create an independent package. In second approach however, there will be a lot of duplicate classes on same SF org if my real business packages are many.
Que: is there a possibility of extending the current classes to define global classes. Then if the library is used as source-library, current usage remains. If I were to use packaged version, the global classes can be used.
Well, thanks anyway. I am first going to start using it, I may have some more time before take a decision of "how to bundle all together".
Regards,
from fflib-apex-common.
If you're an ISV, keep in mind that a separate managed package will also incur an additional security review + fee and that people won't be able to 'one click install' from the AppExchange because of the dependency.
from fflib-apex-common.
Great support @tfuda thanks.
I personally would go with embedding it in the package, duplicates in each org is not a huge problem the platform isolates them via the package namespace as @tfuda points out. I've not heard of anybody adding it in a shared base package, this would be a considerable disadvantage to evolving the code and immediately start to erode the benefit of using an open source package.
Hope this answers your questions @arangari, of course the decision is all yours. Either way glad you've chosen to utilise the libraries and have fun!
from fflib-apex-common.
Related Issues (20)
- Run AEP Apex Sample Code tests against the core AEP Commons library on each push
- Unable to Deploy - Unhandled Exception : java.lang.RuntimeException HOT 1
- Unit test failure in multi-currency org HOT 4
- Deploy button doesn't deploy because there are test failures HOT 1
- Expected a QueryException due to read only user not having access to Opportunity HOT 7
- Switch to Inherited Sharing on SObjectDescribe and SObjectSelector HOT 2
- With latest fflib, do TriggerHandlers become service class consumers? If so what happens to UoW? HOT 6
- Selected tests in fflib_SObjectSelectorTest fail in an org with encryption enabled on Account.Name HOT 2
- Selector Mocks to Include SOQL Query Retrieve Check HOT 1
- fflib_SObjectUnitOfWork doCommitWork executes all dml for all registered types even if there are no changes
- Update README as session recordings are not available HOT 2
- fflib_SObjectDescribe.cls fails to resolve cross-object field paths for Person Accounts
- Aggregate SOQL support. HOT 2
- Disable Savepoint in tests HOT 4
- Inconsistent Code Coverage and Test Failures in fflib-apex-common HOT 1
- fflib_SObjectSelector and fflib_SObjectUnitOfWork have insufficient test code coverage. HOT 2
- Add queryWithBinds to Selector layer HOT 2
- Unit test failing fflib_SecurityUtilsTest & sysadmin_objectAndField_access HOT 8
- Coverage of UnitOfWork class HOT 1
- Versioning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fflib-apex-common.