James, I would typically agree about the bad design part except for the usage of valdiation. Here, all we want to do is validate an object, as you said, and the public API does not take advantage of the static type (such as different parameters). It's better for introspection to occur, IMO.
Paul On Fri, Nov 27, 2009 at 6:47 AM, James Carman <[email protected]> wrote: > Are we going to keep the 2,3,4-arg versions? We have to have one that > accepts Object anyway, so I guess it does keep the API a bit cleaner > to not clutter it with a Map, Collection, etc. version. I really > don't like instanceof in code, though. It just screams bad design. > Usually it means that you aren't thinking in an object-oriented > fashion. > > On Fri, Nov 27, 2009 at 12:08 AM, Paul Benedict <[email protected]> wrote: >> I think we should reduce the overloading and just accept Object. From the >> runtime type, we can determine how to do further checks. Then, we can nicely >> implement 1 args, 2, args, ... and finally var-args overloads. >> >> Paul >> >> On 11/26/2009 10:49 PM, James Carman wrote: >>> >>> So, what you're concerned with is the first parameter (the "thing" we >>> want to check, which we do so by reflection)? Why do we need to >>> change its type? >>> >>> On Thu, Nov 26, 2009 at 10:42 PM, Paul Benedict<[email protected]> >>> wrote: >>> >>>> >>>> James, >>>> >>>> Yes. I want to also eliminate the static types of all the overloaded >>>> methods. We don't need a version for maps, one for char sets, one for >>>> objects, one for collections, etc. We can do all those checks >>>> dynamically. >>>> >>>> This was my point of my original email. What are your thoughts on it? >>>> >>>> Paul >>>> >>>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
