From: Louis J Scoras Date: 2006-05-07T09:17:00+09:00 Subject: Re: Extending Core Classes - Best Practices On 5/6/06, Sam Roberts wrote: > This pattern could help in some cases, but doesn't address a number of > common use cases in which you don't create the string. Like when the > string came out of a library you call, Why can't you wrap the string after you get it? object = SomeLibraryClass.new( #... ) wrapped = WrapperClass.new(object) # do your thing with wrapped > or you are implementing a library and the string was an argument. module M class C def lib_function ( string_from_caller ) wrapped = WrapperClass.new(string_from_caller) # again do your thing with wrapped end end end The probem I see with all that is you risk what makes people--myself included--hate Java: you need to instanciate about 7 different classes to write some output (or whatever). -- Lou