castor

Refactor creation of ClassDescriptors through MappingLoader

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1 M3
  • Component/s: General
  • Labels:
    None
  • Number of attachments :
    5

Description

At the moment MappingLoader's first create a ClassDescriptorImpl instance which later on gets passed to constrator of concrete JDO/XML Classdescriptor. At the whole creation process of ClassDescriptors there are lot of checks for missing or wrong mapping information. My feeling is that quite some if the problems are check twice or more times.

The way i like to go here is to create JDO/XMLClassDescriptors at once without intermediate ClassDescriptorImpl. I also like to move away from passing all information through constrator. Instead I want to set most of the information required for CD after construction through setter methods.

  1. patch-C1644-20061022.txt
    22/Oct/06 4:56 AM
    91 kB
    Ralf Joachim
  2. patch-C1644-20061028.txt
    28/Oct/06 7:41 AM
    104 kB
    Ralf Joachim
  3. patch-C1644-20061029.txt
    29/Oct/06 5:10 PM
    109 kB
    Ralf Joachim
  4. patch-C1644-20061031.txt
    31/Oct/06 2:08 AM
    119 kB
    Ralf Joachim
  5. patch-C1644-20070127.txt
    27/Jan/07 6:22 AM
    113 kB
    Ralf Joachim

Issue Links

Activity

Hide
Ralf Joachim added a comment -

Preview of work in progress.

Show
Ralf Joachim added a comment - Preview of work in progress.
Hide
Ralf Joachim added a comment -

Updated patch preview with work at construction of JDOClassDescriptors through JDOMappingLoader almost finished. Will now focus on the same at XML side.

Show
Ralf Joachim added a comment - Updated patch preview with work at construction of JDOClassDescriptors through JDOMappingLoader almost finished. Will now focus on the same at XML side.
Hide
Ralf Joachim added a comment -

Updated patch preview with creation of intermediate ClassDescriptorImpl at XMLMappingLoader being quite similar to creation of JDOClassDescriptor at JDOMappingLoader. Next I'll move the initialization code from XMLClassDescriptorAdapter into XMLMappingLoader. It seams to me that this will allow us to remove many duplicate checks and redundant transformations. Having said that there is also some more code in createClassDescriptor() method of XMLMappingLoader that needs to be extracted into methods.

Show
Ralf Joachim added a comment - Updated patch preview with creation of intermediate ClassDescriptorImpl at XMLMappingLoader being quite similar to creation of JDOClassDescriptor at JDOMappingLoader. Next I'll move the initialization code from XMLClassDescriptorAdapter into XMLMappingLoader. It seams to me that this will allow us to remove many duplicate checks and redundant transformations. Having said that there is also some more code in createClassDescriptor() method of XMLMappingLoader that needs to be extracted into methods.
Hide
Ralf Joachim added a comment -

Yet another preview. Moved all initialization code from XMLClassDescriptorAdapter into createClassDescriptor() method of XMLMappingLoader. This method now has over 300 lines of code and need quite some serious cleanup as mentioned above. Having said that the initializing constructor of XMLClassDescriptorAdapter still gets called from somewhere else and therefore can not be removed yet. Hope to be able to do so later on.

Show
Ralf Joachim added a comment - Yet another preview. Moved all initialization code from XMLClassDescriptorAdapter into createClassDescriptor() method of XMLMappingLoader. This method now has over 300 lines of code and need quite some serious cleanup as mentioned above. Having said that the initializing constructor of XMLClassDescriptorAdapter still gets called from somewhere else and therefore can not be removed yet. Hope to be able to do so later on.
Hide
Ralf Joachim added a comment -

Need test case of CASTOR-1683 to continue work on this task.

Show
Ralf Joachim added a comment - Need test case of CASTOR-1683 to continue work on this task.
Hide
Ralf Joachim added a comment -

Final patch. All tests pass. There is still more work to be done in that area but I decided to commit this first step for 1.1.

Show
Ralf Joachim added a comment - Final patch. All tests pass. There is still more work to be done in that area but I decided to commit this first step for 1.1.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: