Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bestie
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
bestie
13y ago
Hi Tom I have to disagree, by returning a value and switching on it, not only are you querying state but you risk repeating the query code all over the place. My approach allows you to write a small adapter for your delivery mechanism and u
2.
▲
by
bestie
13y ago
I think this is a really good point, there is a huge difference between trivial data mapping and what an ORM does. Wait while I make this edit ....
3.
▲
by
bestie
13y ago
Route directly how? Write my own HTTP layer? It's so easy to take advantage of Rails' routing and view rendering.
4.
▲
by
bestie
13y ago
It is no co-incidence :) Ben Lane, the founder of The Audacious Art Experiment was one of my closest friends growing up, we were also in a band together.
5.
▲
by
bestie
13y ago
Webby Rails types do often get very aggressive towards this kind of thinking. The point you made about this out-living Rails is a very good one. I'd be coding like this in any language with any framework, Ruby just makes writing SOLID
6.
▲
by
bestie
13y ago
Unfortunately they have all been closed source thus far. The problem with writing good code samples is that it requires a lot of time and thought. This was very much an MVP blog post and appears demand for the sample app / code snipp
7.
▲
by
bestie
13y ago
+1 :)
8.
▲
by
bestie
13y ago
I honestly can't think of any job I'd be happy leaving in the hands of a controller beyond the obvious HTTP routing and view rendering concerns. Even adding a presenter, as I prefer, serializing your data should be handled by your
9.
▲
by
bestie
13y ago
It is useful, the controller in this case handles web concerns and translates a HTTP message into a message that is meaningful to application.
10.
▲
by
bestie
13y ago
So I'm not actually advocating writing an ORM just a data mapper. You map from one hash of data extracted form data base to something like a Struct. There's no SQL generation involved.
11.
▲
by
bestie
13y ago
Having the indirection there allows you to take the Rails features you want with your boundary clearly defining which ones you depend on. You could start with Rails, get ActiveRecord querying, migrations and template rendering for free and
12.
▲
Hexagonal Architecture Guidelines For Rails
(theaudaciouscodeexperiment.com)
50 points
by
bestie
13y ago
|
67 comments