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

RallyCollection is essentially RO #7

Closed
jparrish opened this issue Feb 18, 2013 · 6 comments
Closed

RallyCollection is essentially RO #7

jparrish opened this issue Feb 18, 2013 · 6 comments

Comments

@jparrish
Copy link

Not sure I understand the motivation for changing from returning an array of RallyObjects. Creating a RO collection makes creating a local cache potentially expensive to update. I use to be able to just append a new RallyObject. Now, I'll have to convert the RallyCollection to an array of RallyObjects in the cache - or is there a gotcha I'm not seeing....

@dawsmith8
Copy link

Agreed that it is similar - this is actually some work I'm incorporating from Rally's team. We run some automated tests using ruby and the rally_rest_api gem. We are working to include some changes related to getting tests working with this gem and replacing rally_rest_api. There are some convenience methods in RallyCollection that they use heavily - hence the new addition. I ran some benchmarks against some test data just to check and the effect on performance should be pretty small.

What are you specifically updating in your code that might be expensive? The RallyCollection should still allow append() or <<, if not I can define them to properly work with the internal array.

@jparrish
Copy link
Author

Hi David - I'm curious what "convenience" methods you are referring to that aren't already provided by Array or Hash? As far as I can see, the methods of RallyCollection are simply accessors. e.g. size/length, [], include?, and empty?

I'm creating a local cache of users, projects, workspaces to avoid the overhead of multiple, individual API calls when doing things like creating new users. However, I need to update the cache to account for the new users, and their permissions, and AFAIK the RallyCollection in its current form doesn't support that. So, I'd have to effectively duplicate the RallyCollection in a collection to which I could add new members.

@dawsmith8
Copy link

The each and [] methods have some extra code that allow passing a block used by our tests getting something by name respectively.

If I add << and push to the RallyCollection class - this should then allow you to keep your cache up to date, would that work okay? You should then still be able to keep your code as it is. I can cut an 0.9.2 with that change if that sounds good.

@jparrish
Copy link
Author

Hi David,

Thanks for the quick response!

Yes, I believe any form of add, e.g. push, append, <<, etc. would be all I need.

Thanks!

~jeff

On Feb 21, 2013, at 12:08, David notifications@github.com wrote:

The each and [] methods have some extra code that allow passing a block used by our tests getting something by name respectively.

If I add << and push to the RallyCollection class - this should then allow you to keep your cache up to date, would that work okay? You should then still be able to keep your code as it is. I can cut an 0.9.2 with that change if that sounds good.


Reply to this email directly or view it on GitHub.

@dawsmith8
Copy link

Hi Jeff - done - 0.9.2 is cut and pushed.

@jparrish
Copy link
Author

David, you so Rock!

Thanks.

~jeff

On Feb 22, 2013, at 8:25, David notifications@github.com wrote:

Hi Jeff - done - 0.9.2 is cut and pushed.


Reply to this email directly or view it on GitHub.

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

2 participants