What features did we miss in Salesforce Spring ’17 release?

August 18, 2017

Previous releases of Salesforce were really cool. Take, for example, Lightning Experience for service or Commerce Insights. But there were other valuable features geared to developers that received too little attention even in release notes. Some features got lost among updates to Wave, Einstein and new admin features. Our senior Salesforce expert shares his insights on these awesome functionalities.

Apex Stub API – generally available since Spring ’17

Stub API makes testing easier by implementing mocking framework. Mocks are a powerful tool for Unit Testing.  For example, Mockito and other libs for Java enable true Unit Testing. Now, when building a mocking framework with the stub API, the stub objects are generated dynamically, so there is no need to package and deploy test classes.  As a result, you can either build your own mocking framework or make use of the one built by someone else.

Insights

Imagine you are testing some functionality that intersects with others, thus starting quite complex and intricate processes. With mocking framework, this functionality does not trigger long-term running processes, and the developer can test a specific feature without interfering with all the others involved.

The concept is great, but Apex Stub API has its drawbacks.  For example, mocks have been available for apex development since the lib delivered by FinancialForce (https://github.com/financialforcedev/fflib-apex-mocks), but due to difficulties in implementation and limitations of usage, Stub API seemed like a better solution.  What we received instead is something very similar to the lib in FinancialForce, and is even more limited at times, e.g., static, private, get/set, methods from triggers, inner classes, batchable, system types and singletons are not allowed. Unfortunately, these limitations diminish the value of Stub API because most of the big logic components are stored that way.

Impression

  • Idea – A, Implementation – F
  • Limits need to be improved  

Lightning:container – developer preview since Spring ’17

Content is hosted in an iFrame by the lightning:container component. It enables communication to and from the framed application and thus interacts with the Lightning component.

Insights

Finally, you can store apps directly in Salesforce without using external hosting!

It extends Lightning framework which is limited by default with the help of other frameworks. For example, it provides the ability to host JavaScript frameworks, such as modern React and apps inside Lightning components.  Without limitations that are present in VisualForce, it allows the use of  various directories.

The idea looks promising, although you still can experience some limitations in iFrame. There could be some minor issues with scrolling, caching, etc. It seems like a canvas app, but now it is hosted inside SFDC, which is a great plus.

Impression

  • Idea – A, implementation – B
  • Fingers crossed for this to be released as it is in Developer Preview
  • Limits need to be improved
  • N.B. Content Security Policy can be less strict than in Lightning Framework, which allows us to use lots of javascript libs that had been banned due to security policy for Lightning, e.g., inline javascript and eval are banned due to this.

Senior Salesforce Engineer, CoreValue

Tags

CoreValueSalesforce

Share


Recent Articles

A LITTLE BIT(E) OF GROOVY

December 6, 2017 | Andrew Petryk

Abstract Anyone who has used Java may have faced some struggles. Not all things in vanilla Java, that is to say, without frameworks, are easy to do or clear to understand. On the other hand, you may have a friend who runs Python, for example, and laughs out loud watching you trying to parse a […]

Expert advice: tips for becoming a good PHP developer

December 1, 2017 | Ihor Petrovych

PHP is a language particularly suitable for someone at the start of a career.  Due to the low entry threshold and specifics of the language, many developers begin their professional path there, but then get lost and do not learn to code properly. Like all languages, PHP encompasses both strong and weak points. While there […]