32

I have been developing in Java for some time and have grown accustom to using third party libraries such as Apache Commons for some of the more mundane functions needed in most applications (e.g., Commons Lang's StingUtils class).

I've found this http://code.google.com/p/apex-lang/ and then there's the developerforce code share of course, and possibly apps on the app exchange (didn't see any except apex-lang).

Is there a defacto 3rd party apex library such as Apache Commons is for Java that people here use? Or, is everyone creating their own...consultants, perhaps having a "library" of their own code to copy and paste into client orgs at the start of their projects/contracts.

  • 1
    Apex-Lang was created to address this exact issue. – CoryCowgill Aug 16 '12 at 16:07
21

About the closest thing to Apex libraries is the 'Force.com Labs' apps on the AppExchange that are open-source packages.

They're a good source for some specific code. However, they're not typically distributed as library code.

Also, Force.com's Github contains a good set of SDKs and code-source files for linking into SFDC from a variety of languages and platforms.

| improve this answer | |
11

Apex-lang is about as close to a Java-style library as you can get. Contains several string, database, and collection utilities that mimmick Java functionality. Be aware though, some stuff including Comparing and Sorting collections is out of date with the advent of the Comparable interface in Apex.

In addition to apex-lang, and like you suggest, I typically create or reuse static helper methods throughout my projects. Static helper methods are very convenient for reusing code in Chatter functionality, DML handling, Exception handling, Unit testing, etc.

| improve this answer | |
  • Yup. I use the static methods as well. It is especially useful to use static methods to provide a single place to abstract the building of the data model for the test. – Peter Knolle Aug 17 '12 at 16:55
4
+50

awesome-salesforce is a curated list of Salesforce resources:

What is Awesome Salesforce

Awesome is awesome project started by Sindre Sorhus who is most popular person on Github. He created a project to list down coolest of links bookmarked in your machines and organized them together by compiling them at one place. Later, this projects caught fire and developers community around the world started writing awesome pages (dedicated to their favorite technology).

A Note on Repo AWSomeness

Each repo listed meets at least one of the following requirements:

  • Community-authored repo with 100+ stars
  • Community-vouched repo with 100 stars
| improve this answer | |
  • This repository included the resources of the other answers + more! – Shmuel Kamensky Mar 4 at 5:36
3

As Apex have so many limitations and is extremely limited comparing to the other languages in most of the projects I was participating some Utils class with methods needed to manipulate strings or dates was always sufficient for our needs.

In terms of frameworks/tools which are constantly updated I believe that Apex Enterprise Patterns by Financial Force is actually a good resource. You can also check their other github for libraries connected to Http callouts or for playing with MDAPI

| improve this answer | |
2

I like this set of utilities using kind of Functional Programming inspired by Lodash and Ramda.js

For example for creating queries chaining methods https://github.com/PropicSignifi/Query.apex

List<Contact> contacts =
new Query('Contact').
lookup('AccountId', '001O000001HMWZVIA5').
run();

There are tons of others repositories at https://github.com/PropicSignifi

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.