22

In Summer '17 Salesforce released Platform Events - a native messaging system accessible via Apex and several APIs.

I assume the main use case for such a feature is to allow integration of Salesforce apps into the SOA of a company meaning connecting Salesforce with other enterprise systems.

But...wouldn't Platform Events also be of great help in many native and standalone Salesforce applications? Especially more complex ISV applications?

I'm thinking of Domain Events as Eric Evans defined them in his book which are different than Integration Events as described here.

What's your opinion on this (the most detailed and complete answer will be credited.) Couldn't Platform events also help app developers to:

  1. Decouple monolithic, synchronous Apex apps into an architecture of micro services. Something similar that OSGI or IOC Containers like Spring do. You can find more details in this question Implement Domain Event Pattern in Apex - can and should it be done?
  2. Solve Governor Limit problems by pulling code before and after triggers apart into separate execution contexts
  3. Build a communication channel between Base and Extension Packages without global Apex classes.

Replacing tightly-coupled synchronous Apex code which guarantees all-or-nothing consistency with a loosely coupled asynchronous world surely has many drawbacks. If Salesforce.com had those other use cases in mind I would expect them to also provide solutions for that in the next releases.

  • 2
    An interesting idea, but is it well suited to a question here? Might be more something suitable for a discussion. You could raise your ideas in the Platform Events success group – Daniel Ballinger May 10 '17 at 20:16
  • 3
    I wish we had a space for these questions. For one they bring to light important new features we may have missed and two a good intellectual conversation is a welcome diversion from "I need 100% coverage, please help me its urgent". Maybe we need a true Salesforce Fourm with vBulletin. Maybe I will start one up. – Eric May 11 '17 at 3:06
  • 1
    @DanielBallinger I also posted the topic in the group you mentioned. – Robert Sösemann May 11 '17 at 18:05
  • 2
    @Eric There's always the developer forums if you're feeling masochistic(intending the general use of that adjective). – Daniel Ballinger May 11 '17 at 19:55
  • 1
    One of possible use is described here: salesforce.stackexchange.com/questions/54931/… – Vladyslav K Jun 6 '17 at 17:29
2

This very recent talk by Martin Fowler about The Many Meanings of Event-Driven Architecture contains a lot of wisdom that can help when thinking about how to use this feature in the Salesforce.com ecosystem.

GOTO 2017 • The Many Meanings of Event-Driven Architecture • Martin Fowler

  • A classic use case is to decouple a Salesforce app from other enterprise systems using events (trivial answer)
  • Event can also used internally (just look at how Lightning components work together using low-coupled events
  • Apex code can use command-style and tell what to do OR make changes a first-class code citizen and model state changes explicitly using events
  • Event-based decoupling makes software more flexible but also harder to understand ("What's going on when XYZ happens?") and debug
  • Use Event-Sourcing to seperate the Application State and a Log of all the Events/Changes that created this state (comparable to Version control)
|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.