On Tue, Nov 25, 2014 at 5:37 PM, Jason Fleetwood-Boldt <t...@datatravels.com
> wrote:

I agree that as a framework there is no architectural mandate, and that the
> idea that there is one is a (too) common misconception. It is unfortunate
> that people coming to the framework do not have the perspective to know
> that (and in turn create a lot of unsustainable code).
>
> The main architectural issue I would take with Rails in its entirety (and
> pitfall I’ve seen on dozens of badly written apps myself) is the
> encouragement of over-use of callbacks and, of course, the all-too-common
> domain logic where it shouldn’t be. I’m sure everyone knows on some level
> what I’m talking about, and yes, I agree this is not fundamentally Rails’
> fault but instead the fault of the developers who use it.
>
> I wonder if there’s a way we can provide better documentation or training
> to alternatives design approaches — well within the paradigm of what Rails
> is currently capable of (as you pointed out).
>

I don't know.

For example, some people say business logic in AR models violates SRP!
ZOMG! And look at the ancestor chain! Look at user.methods.size, that...
must break some principle or another!

Those people would write some kind of documentation.

Other people look at the code and say: it's fine and simple to understand,
models encapsulate, some models are not ARs, controllers coordinate. Find a
balance. Extract as needed. Do after/before comparisons. Works like a charm
for many applications. If it does not work for your particular application,
grow a design tailored for it.

In my view, It depends so much on the application and personal design
preferences that you cannot generalize. I don't think "if your ARs grow too
big insert an entire new layer of POROs and extract everything there" is an
advice you can document like that in the Rails documentation, to pick an
example. And the Rails documentation shouldn't have a catalogue of patterns
that we generally cannot recommend by heart.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to