Advantages and Differences of CBRA vs. Rails Engine for Componentization in Existing Monolith

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U782WI24OVK

:wave: <@U7830DMKJNH> That’s interesting! Just read about CBRA and am wondering what are the advantages/differences vs a Rails engine based componetization. Maybe it’s easier to implement coming from an existing Monolith?

Message originally sent by slack user U7830DMKJNH

We’re kind of doing both. Our components are just gems and we sometimes use Railtie to hook-in to Rails or subclass Engine. Contracts have been helpful to expose a small interface without leaking implementation.

<@U782WI24OVK> - In your view what is the difference between CBRA and engine based components?

Message originally sent by slack user U783ITZM13O

We sort of organically started extracting things towards engines. But it’s really a bit of a pain. Now we sort of do it the other way around, we really isolate features and domains into different engines/gems.

Message originally sent by slack user U782WI24OVK

@stephan It’s just that Rails Engines are “native” to Rails and might have not been created specifically for solving the problems we’re concerned about, even though they do help to solve it

Message originally sent by slack user U782WI24OVK

CBRA seems to have been created specifically for our problem.

totally agree on the original intent for engines…

I guess I am still confused - what then is CBRA? I use it to refer to my own work on component-based Rails apps, like cbra.info and https://www.amazon.com/Component-Based-Rails-Applications-Addison-Wesley-Professional/dp/0134774582 and all that work is just about gems and engines…

Just want to make sure there isn’t another project out there that happened onto the same acronym :smile:

Message originally sent by slack user U782WI24OVK

Oh no, sorry about the confusion. We’re talking about the same thing, I just had my first peak at CBRA yesterday and was only aware of Rails Engines before then. Hence my fuzzy comparison… Great to have you here!

gotcha!

CBRA is gems all the way down :gem:

… some of those gems are engines

happy to chat async or sync about this stuff.

Message originally sent by slack user U782WI24OVK

I’ll dig more into the topic and ping you with any questions. Thanks!