facebook

Spring DSL corrupts existing source – Demonstrated

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #320373 Reply

    Glen Ihrig
    Member

    Spring DSL corrupts existing source – Demonstrated

    I’m not sure that this exercise accurately reflects the issue of the DSL corrupting code as
    discussed in these threads, but it seems to be a simple demonstration of what might be happening:

    9.1 Spring DSL trashes generated code
    https://www.genuitec.com/forums/topic/9-1-spring-dsl-trashes-generated-code/&highlight=

    Unbelievably frustrating autogeneration!!
    https://www.genuitec.com/forums/topic/unbelievably-frustrating-autogeneration/&highlight=

    The problem I have been experiencing is that at unexpected points in development my code is
    corrupted, requiring unexpected ‘repair’ work. It’s become a significant distraction.

    Hopefully, the following will be helpful.

    For the time being, I must simply abandon the Spring DSL. At times I get a lot of value from it …

    I have attached the sample project in before and after states, plus the ME4S Installation Details.
    The corrupt project file also contains a .log file.

    Any suggestions, encouragement, etc, would be greatly appreciated.

    Regards,

    -Glen

    Procedure
    ———

    
    1. Import project archive
    
        DWR-AJAX-002_code-complete_debugging_DWR.zip
        
    2. Edit src/...service/CarsFacade.Java (recommend making a copy of this class for later comparison).
    
    3. Rename CarsFacade.java to CarsFacadeImpl.java. Do not update references.
    
    4. Select CarsFacadeImpl.java in project explorer, then 
       - Execute Refactor > Extract Interface, 
       - Name the new interface CarsFacade
       - Check all methods
       - OK
       
    5. Add annotations to the CarsFacade class definition 
       @Service("CarsFacade")
       @Transactional 
       
       - Add the required imports
       - Save
        
        This last change resulted in a flurry of activity that left CarsFacadeImpl in a 
        non-compilable state.
    
    6. Results    
        CarsFacade
        - Source was reverse engineered, CarsFacade now appears in Spring DSL
        - Comments in CarsFacade are all replaced with @ModelCoreReference ... or 
          @ModelReference ... but otherwise the CarsFacade interface seems to be correct.
          
        CarsFacadeImpl
        - Javadoc comments at the class level are overwitten with @ModelCoreReference ... 
          and @ModelReference ...
        - New methods are written with @ModelReference annotations and empty bodies. 
          These are given @Transactional annotations.
        - The original methods are left in the code, with changes (causing compile errors).
        - Original Javadoc comments are replaced with 'non-Javadoc' comments including 
          @ModelReference annotations.
        - @Override annotations are applied to the original methods.
        
        Spring DSL
        - A correct looking entry for CarsFacade has been added.
    
    Attachments:
    You must be logged in to view attached files.
    #320450 Reply

    Glen Ihrig
    Member

    At least some of the confusion regarding comments is caused by (My?)Eclipse Refactor > Extract Interface. Existing comments in the original source class are _moved_ to the new Interface and reference comments to the interface are inserted in their place.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Spring DSL corrupts existing source – Demonstrated

You must be logged in to post in the forum log in