Re: Generics

From: Todd O'Bryan (toddobrya..ac.com)
Date: Mon Feb 27 2006 - 06:31:56 EST

  • Next message: Andrus Adamchik: "Re: SingleObjectQuery & ObjectID"

    On Feb 26, 2006, at 11:51 PM, Cris Daniluk wrote:

    > In my opinion, type safety either is... or isn't... :)
    >
    > I'm not entirely sure that selectively adding generics is the right
    > way to go, because it means that what should be two functionally
    > equivalent operations become different. For example,
    > SelectQuery(String, Expression) would differ from SelectQuery(String,
    > Expression). I'd definitely love to explore the possibility of
    > increasing the type safety, but I think its going to require a lot
    > more thought to get there, and at questionable value.
    >
    > Cris

    You meant SelectQuery(Class, Expression) vs. SelectQuery(String,
    Expression), right?

    I've never actually understood why the second was in there. I like
    the compiler checking my spelling, and that only happens in the
    first. And you can always use Class.forName() if you really want to
    use a String. There's probably a reason it's necessary that I'm not
    aware of.

    Todd



    This archive was generated by hypermail 2.0.0 : Mon Feb 27 2006 - 06:32:07 EST