From: Jean-denis Vauguet Date: 2010-03-22T02:44:24+09:00 Subject: Re: A plugin system using extend James Edward Gray II wrote: > On Mar 21, 2010, at 2:13 AM, Jean-denis Vauguet wrote: > >> behavior of any instance without the need for aliasing. Same behavior as >> my standalone and Josh codes, but same flexibility as my previous gist >> attempted to achieve. >> >> I'll give it a try when I get the time to, unless I'm told this is BS ;) > > If I understand what you are saying correctly, I've used this exact > strategy in the past. > > I allowed plugins to register themselves on the class object (you can > also do that automatically as they are defined with an inherited hook), > and then I just extended all instances with the registered plugins as > they were created. > > It worked great and felt very natural to me when using it. > > James Edward Gray II Thank you for this feedback. You understood well I guess. This is good pattern IMO too: you both get rid of dirty aliasing, and enable clean inheritance with super. I did not have the time to try it out yet, but I guess it should just work :) If it performs zell, I'll try to make it more generic (a kind of "Pluginable" gem?). By the way, would you have any code snippet to illustrate the pattern? That could come in handy when refactoring my code, for I'm sure you're definitely more skilled at writing this kind of stuff than I currently am ;) -- Posted via http://www.ruby-forum.com/.