Live data from Hacker News

Trailblazer: A new architecture for Rails

github.com

1–10 of 53 posts

Re: Trailblazer: A new architecture for Rails

#4
post #2

I'm intrigued, and would love to hear of anyone's experience using this, particularly in a production environment. One question: does it have performance implications, one way or another?

I haven't used it, but read up on it after starting to use the Reform gem. It seems more geared toward forcing cleaner, more encapsulated code, which should make your rails app more maintainable in the long run. I don't think that there's any major functional changes that would impact performance.

Re: Trailblazer: A new architecture for Rails

#7

Architecture Astronaut

Say that again after you have to learn a rails app with 1500 line models built "the rails way." Controller -> model breaks down when you reach a certain size.

Or worse, giant controllers and models with no clear distinction.

Re: Trailblazer: A new architecture for Rails

#8
post #7

Architecture Astronaut

Say that again after you have to learn a rails app with 1500 line models built "the rails way." Controller -> model breaks down when you reach a certain size. Or worse, giant controllers and models with no clear distinction.

You can go a long way with using simple Ruby objects to break up logic and separate out logic from models. If developers are writing 1500 line models and the lead developer isn't doing anything about it a adding new abstract concepts isn't going to help.

Re: Trailblazer: A new architecture for Rails

#9
I like that Trailblazer is promoting some concepts I'd like to see more rails devs use (service objects, form objects), I think this project will be a non-starter for most teams. But after giving the readme a once over and looking at the source code a bit, here are the concerns I would raise:

1. What advantage does this have over using the components it's wrapping? Why not just use the reform or representable gems directly?

2. Things like this introduce a steeper learning curve for newer rails devs, especially when they cause application architecture to deviate so much from what's commonly found in the documentation already available.

3. There seems to be no real documentation on what testing facilities are available for this framework.

That being said, this is not bad at all for a pre 1.0 release. I don't always agree with some of the decisions apotonick (the author) in the code he publishes, but I do respect him for the fact that his work promotes a lot of discussion in the ruby/rails ecosystem.

Re: Trailblazer: A new architecture for Rails

#10
post #7

Earlier quoted context omitted.

Say that again after you have to learn a rails app with 1500 line models built "the rails way." Controller -> model breaks down when you reach a certain size. Or worse, giant controllers and models with no clear distinction.

You can go a long way with using simple Ruby objects to break up logic and separate out logic from models. If developers are writing 1500 line models and the lead developer isn't doing anything about it a adding new abstract concepts isn't going to help.

I really cant agree with this enough.

A very common example of model bloat I see is authorization logic, and libraries like Pundit do an excellent job providing a simple framework for extracting such logic into their own ruby classes.

Post reply on HN