Re: abstract superclasses

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Mar 08 2005 - 09:40:34 EST

  • Next message: Andrus Adamchik: "Re: abstract superclasses"

    Cris Daniluk <cris.danilu..laraview.com> wrote:
    > Are there any dangers in creating abstract superclasses? I had to update
    my
    > template to do this, as I was using an abstract base class that had a
    method
    > to be implemented manually in the data objects. It seems to be working
    fine,
    > but I don't know if there's any subtle danger in doing this?
    >
    > If not, is there any objection to just making the superclass abstract
    > period? I don't see any non-internal reason to ever instantiate these
    > directly.

    Not sure if you're talking about CayenneDataObject or the _CLASS files
    generated by default.

    In either case, the answer is the same. Why remove functionality when it
    costs you nothing to leave it in?

    I'm hoping that the case for CayenneDataObject is obvious (ie, it's the
    equivalent of EOGenericRecord in EOF). In fact, all of your generated
    classes are simply convenience wrappers for CayenneDataObject.

    As for the _CLASS files, there are use cases out there even if you don't
    always see them.

    A few months back, someone posted a tool named ObjectVisualizer
    (http://www.opensourcesoft.net) that would load cayenne classes using
    introspection into a visualizer tool. A big problem with it was that it
    created objects at the CLASS level rather than at the _CLASS level, causing
    all sorts of side effects with business logic in the CLASS file when it
    could have all been avoided using the _CLASS file. Of course it possibly
    could have also been done using CayenneDataObject, but there's no easy way
    to pull out the keys.

    -Mike



    This archive was generated by hypermail 2.0.0 : Tue Mar 08 2005 - 09:39:41 EST