Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Records should be called something else #18

Closed
jnicklas opened this issue Nov 10, 2011 · 5 comments
Closed

Records should be called something else #18

jnicklas opened this issue Nov 10, 2011 · 5 comments

Comments

@jnicklas
Copy link

Sorry I am spamming the issue tracker with a lot of dumb stuff. Just had this realization.

When using a datastore that isn't an ORM/ODM, it doesn't really make sense to talk about records. Since Raptor wants to make no assumption as to how we're structuring our app, and it would make a lot of sense for the "Record" in a lot of cases not to map 1-1 to a database row/document, I think it should have a different name.

Resource is kind of already taken by raptors nomenclature, otherwise that would have been good, maybe Model is better? What do you think?

@garybernhardt
Copy link
Owner

"Model" scares me because Rails programmers are going to see it and think "Oh—the thing that maps to my database and contains my entire application's logic". :(

What about "subject"? It kinda makes sense... most of the Ruby code is just building up the thing we're talking about, then the presenter/view/template layer talks about it. Might be confusing when using RSpec's "subject" to mean other things, though. cc @tcrayford

@tcrayford
Copy link
Collaborator

I dislike subject (compared to record anyway), and model has the whole rails connotations problem. I like records a whole bunch.

@garybernhardt
Copy link
Owner

I just realized that @jnicklas is talking about the Record class, not the internal name. I have my head stuck in the other design discussion thread. To separate the things:

  1. Raptor needs a name for the things returned from route delegates (interactors). "Response model" is the traditional name, but I'd prefer one word. This is what I was thinking of when I said "subject".
  2. Raptor needs a class name for the default routes to delegate to. E.g., create routes currently delegate to MyResource::Record. If/when the great module inversion of How should applications be structured? #23 lands, this would become Records::MyResource.

The default delegate targets are going to depend on the storage system used (AR vs. Ohm vs. Mongoid are going to need very different names); it's probably going to need to be pluggable. Personally, I find "Record" a decent default, because the term makes sense for all of those system. "Row" wouldn't but I think it's fair to call a Mongo document or a Redis key a "record" in their respective databases.

@tcrayford
Copy link
Collaborator

In which case, I'm down with subject.

@garybernhardt
Copy link
Owner

Done; @tcrayford changed it to subject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants