Torque
  1. Torque
  2. TORQUE-166

remove the getOMClass() method, the CLASS_DEFAULT constant and the initClass() method in the generated peers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-beta1
    • Component/s: None
    • Labels:
      None

      Description

      These methods and constants were used by village and are not needed any more.

        Activity

        Thomas Fox created issue -
        Thomas Fox made changes -
        Field Original Value New Value
        Assignee Thomas Fox [ tfischer ]
        Show
        Thomas Fox added a comment - This was discussed on the dev list, see http://mail-archives.apache.org/mod_mbox/db-torque-dev/201105.mbox/%3COF47D897B4.2412951A-ONC125788B.00405C58-C125788B.006E22D4@seitenbau.net%3E and followups
        Hide
        CG Monroe added a comment -

        Personally, I'd like to see this remain even if we aren't using it internally.

        The use case for keeping this is user written functions that take a generic Peer class as a parameter and then need to get a record object.

        I found it useful in 3.x that given one of any of the main classes (e.g. Map, Peer, or OM), you can easily access the other two via methods in the class you have. Makes righting dynamic code like application specific import and export function easier.

        Show
        CG Monroe added a comment - Personally, I'd like to see this remain even if we aren't using it internally. The use case for keeping this is user written functions that take a generic Peer class as a parameter and then need to get a record object. I found it useful in 3.x that given one of any of the main classes (e.g. Map, Peer, or OM), you can easily access the other two via methods in the class you have. Makes righting dynamic code like application specific import and export function easier.
        Hide
        Thomas Fox added a comment -

        What about generating a getOMInstance method in the Peer returning a new OMClass() ?
        In my opinion we should avoid using reflection wherever possible. Also, getOMInstance() is more flexible, one can override the method and instantiate classes which do not have a no-arg constructor.
        When needed, one can still find out the OMClass by getOMInstance().getClass()

        Show
        Thomas Fox added a comment - What about generating a getOMInstance method in the Peer returning a new OMClass() ? In my opinion we should avoid using reflection wherever possible. Also, getOMInstance() is more flexible, one can override the method and instantiate classes which do not have a no-arg constructor. When needed, one can still find out the OMClass by getOMInstance().getClass()
        Hide
        CG Monroe added a comment -

        That works for me... I only care about getting access to a record class and not the underlying methodology.

        Re: reflection. Agree we shouldn't use it internally but when external users are dealing with the generated code it is sometimes the only way to get things to work. May not like it but you can't ignore there is a bunch of gee whiz code out there that uses it.

        Show
        CG Monroe added a comment - That works for me... I only care about getting access to a record class and not the underlying methodology. Re: reflection. Agree we shouldn't use it internally but when external users are dealing with the generated code it is sometimes the only way to get things to work. May not like it but you can't ignore there is a bunch of gee whiz code out there that uses it.
        Hide
        Thomas Fox added a comment -

        The new method is called getDbObjectInstance() since the OM terminology is no longer used

        Show
        Thomas Fox added a comment - The new method is called getDbObjectInstance() since the OM terminology is no longer used
        Thomas Fox made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.0 [ 12312102 ]
        Resolution Fixed [ 1 ]
        Thomas Fox made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3d 23h 52m 1 Thomas Fox 19/Jul/11 16:51
        Resolved Resolved Closed Closed
        432d 15h 15m 1 Thomas Fox 24/Sep/12 08:06

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Thomas Fox
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development