Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3.1
    • Component/s: JDO queries
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      AHMAD HASSAN added a comment - - edited

      Planned to re-structure the SQLStatementRemove class on the following pattern.

      1) Writing Getters and Setters methods for the private class attributes.

      2) buildStatement Method
      a) I think it is better to remove the part of getting collumn info for identities from this method and instead we pass the ID's array as parameter to buildStatement method. getColumninfoforidentities should be performed in the class who is calling buildStatement method.

      b) or 2nd approach would be that we do getColumninfoforidentities in the constructor at the time of initialization because it will be used by both buildStatment method and executeStatement method

      3) executeStatment
      a) Same as above. Shift getColumnInfoforIdentities from it and then pass it as a parameter. or call it in constructor. I think doing the above functionality in constructor seems good idea. Suggestions?

      b) Separate the prepareStatement stuff from this method to the separate method which just prepares the statment for the connection passed as parameter

      c) Shift the identity size check from this method because it is not the processing of this layer

      d) Shift extended.delete(con, identity) from this method

      The code will be more structured and readable then.

      Hi Ralf, Can you please guide me where can I shift the code of getcolumninfoforidentities, identity size check and extended delete ?

      I went through different classes and I think SQLEngine is playing with the identities and extended stuff. Can you please point me to the actual code which is making use of this SQLStatmentRemove class so that we can shift that code there.

      Any comments or suggestions Please.

      Thanks.

      Show
      AHMAD HASSAN added a comment - - edited Planned to re-structure the SQLStatementRemove class on the following pattern. 1) Writing Getters and Setters methods for the private class attributes. 2) buildStatement Method a) I think it is better to remove the part of getting collumn info for identities from this method and instead we pass the ID's array as parameter to buildStatement method. getColumninfoforidentities should be performed in the class who is calling buildStatement method. b) or 2nd approach would be that we do getColumninfoforidentities in the constructor at the time of initialization because it will be used by both buildStatment method and executeStatement method 3) executeStatment a) Same as above. Shift getColumnInfoforIdentities from it and then pass it as a parameter. or call it in constructor. I think doing the above functionality in constructor seems good idea. Suggestions? b) Separate the prepareStatement stuff from this method to the separate method which just prepares the statment for the connection passed as parameter c) Shift the identity size check from this method because it is not the processing of this layer d) Shift extended.delete(con, identity) from this method The code will be more structured and readable then. Hi Ralf, Can you please guide me where can I shift the code of getcolumninfoforidentities, identity size check and extended delete ? I went through different classes and I think SQLEngine is playing with the identities and extended stuff. Can you please point me to the actual code which is making use of this SQLStatmentRemove class so that we can shift that code there. Any comments or suggestions Please. Thanks.
      Hide
      Ralf Joachim added a comment -

      1) Not sure yet if getters/setters would be needed here. Let's take a look at this after we did some initial improvement steps.

      2) Let's pass the ID's array to the constructor which gets called by SQLEngine which also is responsible for the ID's array.

      3) b) Do preparation of statement in a separate method. As we do not know when connection changes at the moment, we have to call prepare and execute from SQLEngine each time.

      3) c) Shift identity check from SQLStatementRemove to SQLEngine. Not sure yet if this will be the final place but moving this to ClassMolder would be more difficult. Maybe we do that at a later step.

      3) d) Shift deletion of records of extended objects from SQLStatementRemove to ClassMolder

      Show
      Ralf Joachim added a comment - 1) Not sure yet if getters/setters would be needed here. Let's take a look at this after we did some initial improvement steps. 2) Let's pass the ID's array to the constructor which gets called by SQLEngine which also is responsible for the ID's array. 3) b) Do preparation of statement in a separate method. As we do not know when connection changes at the moment, we have to call prepare and execute from SQLEngine each time. 3) c) Shift identity check from SQLStatementRemove to SQLEngine. Not sure yet if this will be the final place but moving this to ClassMolder would be more difficult. Maybe we do that at a later step. 3) d) Shift deletion of records of extended objects from SQLStatementRemove to ClassMolder
      Hide
      Ralf Joachim added a comment -

      As last subtask got fixed we can also resolve this issue.

      Show
      Ralf Joachim added a comment - As last subtask got fixed we can also resolve this issue.

        People

        • Assignee:
          AHMAD HASSAN
          Reporter:
          Ralf Joachim
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: