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

Redis::Objects methods need better name-spacing #153

Closed
UniIsland opened this issue Sep 18, 2014 · 5 comments
Closed

Redis::Objects methods need better name-spacing #153

UniIsland opened this issue Sep 18, 2014 · 5 comments
Labels

Comments

@UniIsland
Copy link

The instance method names Redis::Objects currently takes (value,list,lock,set,etc) are too common, and can easily conflict with existing methods or method from 3rd party plugins.

Should we add a redis_ prefix, for instance, to the methods names?

I'd love to help out write the patch when the discussion gets a result.

@SFEley
Copy link

SFEley commented Sep 21, 2014

I think prefixing all the methods would be far too ugly for typical use. A single class bringing in so many dependencies that the developer can't keep track of where its methods are coming from probably has opportunities to be broken up or simplified. (Yes, I know, ActiveRecord. That's part of why I don't like to use it.)

I think a better answer would be an optional module that brought in Redis::Objects, but used alias_method and remove_method to rename all of its methods with the redis_ prefix. You could call it Redis::Objects::Aliased for clarity, and you could even automate the renaming with the appropriate hook methods.

@nateware
Copy link
Owner

Have you hit this in real world usage, or is this theoretical?

@UniIsland
Copy link
Author

Added a real world usage in #196 ;)

@ShiningRay
Copy link

At least we should output a "Warning: overwrite method" to developers.

@nateware
Copy link
Owner

Closing as changing the namespace this late into the library's lifetime would be very disruptive.

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

No branches or pull requests

4 participants