From: Robert Klemme Date: 2007-08-08T00:30:03+09:00 Subject: Re: Better way to do this? Currently using two method_missing calls... On 07.08.2007 16:09, Dan wrote: >> Can you explain why you are reluctant to create an instance for this? >> Generally, creating and manipulating objects is all OO is about. :-) >> More specifically, since your remote call is likely an order of >> magnitude slower than the instance creation performance effects are >> negligible. > > Fair point :). Actually, I'm less concerned about performance then > code clarity. Since I'm just posting to a url, I only want to convert > the object-like notation to a string. Creating a bunch of objects just > to facilitate that notation seems like extra confusion. We're not talking about a "bunch", are we? The reason I keep stressing this point is that more often than not I have seen OO programs make too few use of classes than making too much use of classes. Somehow people seem to think a class is something big or heavyweight so it should be avoided - or at least kept to a minimum. IMHO that leads to less modularized and more difficult to read code. Stuffing everything into only few classes that have a large number of methods makes things harder to understand and reuse than having many classes which focus on only few related tasks and that use other classes for unrelated tasks. Sorry, I *had* to say it at some point in time. :-) Kind regards robert