Re: superclass template question

From: Cris Daniluk (cris.danilu..mail.com)
Date: Wed May 11 2005 - 11:22:25 EDT

  • Next message: Andrus Adamchik: "Re: trouble with data-port"

    > > I think it's a bad idea to have your superclass directly refer to the
    > > subclass. I also don't think that information is available.
    > > What task are you trying to accomplish?
    >
    > I disagree... We are talking about generated code. The information
    > comes from ObjEntity. So you may think of it as referring to an entity
    > mapped class (that coincidentally happens to be a subclass of a
    > generated class). Actually superclass "knows" about subclasses of
    > related objects already (when building relationships accessors), so I
    > don't see a problem with this approach.
    >

    Mike's point is that the superclass depending on the subclass creates
    a bidirectional coupling, but I think that's fine... the purpose of
    the split class approach isn't to allow you to extend your own classes
    from the superclass. The purpose is to allow you to essentially safely
    "modify" the generated code.

    Also, I disagree with the idea that it is better to use a
    less-typesafe alternative in the base class. One of the advantages in
    generated code is being able to increase type safety. By all means,
    use that to its fullest advantage!

    Cris



    This archive was generated by hypermail 2.0.0 : Wed May 11 2005 - 11:22:27 EDT