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

Separate entities into grape-entity #294

Closed
dblock opened this issue Dec 24, 2012 · 6 comments
Closed

Separate entities into grape-entity #294

dblock opened this issue Dec 24, 2012 · 6 comments

Comments

@dblock
Copy link
Member

dblock commented Dec 24, 2012

Entites in Grape are a specialized way of representing objects. There's nothing in them that's truly grape-specific, although there's a bit of integration with parameters and such. I suggest we split entites into a new gem, much like roar or rabl.

@idyll
Copy link
Contributor

idyll commented Jan 12, 2013

I've already tried the extraction once and it seemed to work quite well. I pretty much just pulled out the code and related specs.

I am going to take a shot at this over the weekend.

Once it is working I will add you as an admin to the new project so that you can transfer it to where it should really live.

@idyll
Copy link
Contributor

idyll commented Jan 12, 2013

Okay, I've got them pulled out here:

https://github.com/agileanimal/grape-entity

with a working branch of grape here:

https://github.com/agileanimal/grape/tree/extract-entities

To finish things up we should agree on where the gem should live. Then I can update the documentation. @dblock I have added you to the repos so you can take ownership and move it if you'd like. I am also fine with maintaining this if you'd prefer.

@dblock
Copy link
Member Author

dblock commented Jan 13, 2013

This is awesome. The gem can live with you and you should totally maintain it. I am happy to help as usual. I want to make some suggestions, will make PRs and we can discuss them there.

Make a pull request for getting rid of entities inside Grape proper, please.

@idyll
Copy link
Contributor

idyll commented Jan 13, 2013

Okay I am going to iterate on this a bit. I will push the entities gem up as a starting point and try and get something really usable by the end of the week.

I think the first two goals should be improve the testability of entities and (as you noted) proper decoupling from Grape.

I like simplicity of entities for small projects so I am a bit biased - I'd prefer to leave them as the default for Grape, with the option to exclude them and replace them with another option - but lets get things to the point where they are completely decoupled and then that decision can be made.

@idyll
Copy link
Contributor

idyll commented Jan 13, 2013

Something has been bothering me since I wrote this. Hypermedia. I know Roar does this, but it doesn't fit in my world view of what an Entity does. If an Entity is a Facade on the model it shouldn't know about Hypermedia.

Hypermedia feels like it fits in more with something like a formatter. Maybe even further from the model than that.

I want the result of this to facilitate (but not require) hypermedia.

@dblock
Copy link
Member Author

dblock commented Jan 13, 2013

I've merged the PR with additional README and spec changes. We no longer require grape-entity at runtime, so this will be a breaking change for those using Entities for the next 0.3.0 release. I think it's the right thing to do.

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

No branches or pull requests

2 participants