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

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.


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.

  • 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

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.