Simon Vandemoortele wrote: > On Wed, 30 Apr 2003 at 18:07 GMT, Dave Thomas wrote: > >>Is a Contact that you return as the result of a search(say) the same >>type of thing that you use to create or edit a new entry? > > > Yes. See below... :) >>Your assumption is that they are (basically) the same thing, but perhaps >>you might want to rethink that. They don't seem to share the same >>methods. Maybe you need two classes: Contact and MutableContact. Regular >>Contact classes have methods that let them be examined but not altered. >>MutableContacts allow change. If needed by your application, class >>Contact could include a #to_matuable method that returned a MutableContact. > > > Hmmm. I never thought about that, mainly because it requires creating > two types of contacts that will hold _exactly_ the same data. I will > take it into consideration. Remember: objects equal data + operations. Two objects have different types if they differ in either. Also remember, their may be a subclassing or delegation interface between the mutable and immutable interfaces; there's nothing to say that you have to duplicate information. Cheers Dave