How to avoid if/else with different ramifications

This page summarizes the projects mentioned and recommended in the original post on /r/rails

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Interactor

    Interactor provides a common interface for performing complex user interactions.

  • You might be looking for an interactor pattern for these services. I've used this gem for similar things before and have had good experiences.

  • wisper

    A micro library providing Ruby objects with Publish-Subscribe capabilities

  • I would use events. Every services broadcast its results and everything that needs to listen for them. It also great to decouple dependencies between services. I like the Wisper gem : https://github.com/krisleech/wisper

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Light Service

    Series of Actions with an emphasis on simplicity.

  • Similar to the above recommendations of Railway Orientated Programming and the Interactor gem, I use the Light Service gem. While it can sometimes be a bit verbose it excels in code reuse, testability, and composition.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts