Hard Migration – Copy, Paste and Change

Hard Migration – Copy, Paste and Change

The hard migration is useful, when the goal is, to migrate an OpenEdge application the fastest way, let’s say from ADM to HTML5 UI. The copy, paste and change approach keeps the work flow and logic of existing programs, so the migration risks are low.

 

This migration strategy is based on the unique structure of OF-1, where any source code is ABL. To program data fetching or handle user interactions – so called client logic or screen logic – you can use more or less the same code as is use in an ADM/2 or GUI Builder / Appbuilder.

Hard migration combined screenshots

PHASE 1: REBUILD UI IN OF-1

In the first phase the UI is rebuild in the GUI builder of OF-1. This is very simple and straightforward, any ADM components have comparable components in OF-1 (besides that, OF-1 has a lot of enhanced components). When widget names are the same (or alike) the names in source program, the code will run OF-1 with very little changes.

The component classes of OF-1 have an abstract UI implementation. During run time the screen will be rendered in .NET or using the Skin-Client rendered in HTML5.

PHASE 2: COPY AND CHANGE LOGIC

The application has – in a very rough view – two parts, the Screen Logic (everything manipulating the widgets) and Business Logic (everything loading, storing and manipulating data).

 

Any screen will be rebuild in the OF-1 Screen Designer. This could done very fast, and names of widgets should be the same as before or derived from source widgets. The Screen Logic will be reused in the client user exits (also called client hooks or client UI trigger) of OF-1. Any operation like ENABLE has a similar call in OF-1, so copy and change (search & replace) will make the old source working in OF-1. If dynamic widgets are used, they can be created in a similar way in OF-1.

blog_hard_migration_img2
/***** Old code, ADM style *****/ 

/* Access screen widgets */ 
ASSIGN vonobjekt:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "" 
       bisobjekt:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "". 

CASE Radio-Set-1:SCREEN-VALUE IN FRAME {&FRAME-NAME}: 
  WHEN '1' THEN DO: 
    DYNAMIC-FUNCTION('hideWidget':U IN h_btbank_auszug, INPUT 'Mobjekt').  
    DYNAMIC-FUNCTION('ViewWidget':U IN h_btbank_auszug, INPUT 'objekt').  
    DISABLE einzelinvestor WITH FRAME {&FRAME-NAME}. 
    HIDE einzelinvestor IN FRAME {&FRAME-NAME}. 
  END. 
  WHEN ...
/**** New code, OF-1 / OO style. *****/ 

/* Access abstract OF-1 component objects */ 
ASSIGN ovonObjekt:cSCREEN-VALUE = "" 
       obisObjekt:cSCREEN-VALUE = "". 

/* Attributes like SCREEN-VALUE are accessible in 
   OF-1 in similar attributes like cSCREEN-VALUE */ 
IF orsWegMv:cSCREEN-VALUE = "WEG" THEN DO: 
  ASSIGN 
    obrw_hv_tbank_auszug_Mobjekt:lVisible = FALSE 
    obrw_hv_tbank_auszug_Objekt:lVisible  = TRUE 
    ocbInvestor:lVisible                  = FALSE. 
END. 
ELSe...

The Business Logic of master data programs is literally zero! OF-1 has logic for data handling (find, udate, sort and so forth) build in – it is a core part of the framework, implemented in the system classes.
When Business Logic is more complex, it can be reused in the server side user exist (also know as server hooks, or AppServer trigger) of OF-1. A Business Entity will be created for any screen of medium or high complexity level. Existing code will be reused and include files will be also reused. Due to the approach to be fast, only minor changes will be done in Business Logic.

PHASE 3: HTML5 AND NEW FUNCTIONALITY

When the application is completely transformed into an OF-1 application, it runs as .NET UI application or as HTML5 in a browser. New functionality will be added when the project is stable.

ADVANTAGES AND DISADVANTAGES

ADVANTAGES

  • HTML5 UI – Address the SaaS market
  • Fast – Fastest known migration concept
  • Simple – A trainee is able to build screens and copy/change simple to medium logic
  • Low risk – The working application is rebuild
  • High user acceptance – User can go on working with a similar application
  • Improved application – OF-1 hast a lot of build in functionality, which is active

DISADVANTAGES

  • Same workflow – Workflow and screen enhancements are done later
  • Code not better than before – Everything if OF-1 is OO, but in general code stays the same
  • Many Business Logic classes – Simplification process can start after migration

SUMMARY

The unique structure of OF-1 allows to reuse existing screen and business logic with copy and change in the fastest possible way, to bring ADM style OpenEdge applications to .NET or HTML5.