migrating 4gl to genero a case study tom smith fourth generation software waiug/seiug washington...

34
Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

Upload: kyleigh-primmer

Post on 22-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

Migrating 4GL to Genero

A Case StudyTom Smith

Fourth Generation Software

WAIUG/SEIUG Washington 2006

Page 2: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

2

Introduction

Tom SmithSenior Tools Developer

Fourth Generation Software

Page 3: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

3

Agenda

Our GoalsOur Goals

The Planning ProcessThe Planning Process

The Conversion ProcessThe Conversion Process

Question & AnswerQuestion & Answer

Differences from Four J’s BDLDifferences from Four J’s BDL

Technical Topics and ExamplesTechnical Topics and Examples

Page 4: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

4

Our Starting Point

Software companyTool (RAD/CASE)Accounting PackageSingle code stream

Page 5: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

5

Our Goals

Goal #1: Standard Windows UI Other goals:

Major Update NOT Rewrite Clean Code Customer Migration Path

Page 6: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

6

Big Concessions

Not Backward Compatible Drop Text UI

Page 7: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

7

Key Features Required

Standard Windows Key StrokesWindows Look & FeelTop MenuTool BarsRight Click

Page 8: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

8

Informix 4GL

Page 9: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

9

Four J’s BDL

Page 10: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

10

Four J’s Genero

Page 11: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

11

The Planning Process

Levels of Conversion

Level 1: Almost no conversion

Page 12: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

12

The Planning Process

Levels of Conversion

Level 2: Minimum conversion

Page 13: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

13

The Planning Process

Levels of Conversion

Level 3: Extended conversion

Page 14: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

14

The Planning Process

Levels of Conversion Level 4: Full conversion

Do Extended conversion plus: Localized strings TEXTEDIT COMBOBOX RADIOGROUP CHECKBOX FOLDER/PAGE ( screen tabs)

GROUP STRING

Page 15: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

15

The Planning Process

Analysis Scope Programming Consistency Generated Code? Can Code Changes Be Automated. Retain Dual Environments? Convert all-at-one-time?

Page 16: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

16

The Conversion Process

Low level code (libraries) UI statements: Window/form:

OPEN WINDOW, OPEN FORM... Interactive instructions:

MENU, INPUT, INPUT ARRAY, CONSTRUCT and DISPLAY ARRAY

4gl and 'C' routines. Remove references to 'PROMPT' and 'DISPLAY AT'

statementsHigh level code (applications)TestDeploy

Page 17: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

17

Differences from Four J’s BDL

What Has NOT changed Language structure Tools:

fgl2p, fglform, fglcomp, fgllink, fglmkrun, fglrun, fglschema (fgldbsch), fglWrt

Environment variables

Page 18: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

18

Differences from Four J’s BDL

What HAS changed Style Sheets FGLPROFILE

Page 19: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

19

What you need to now about XML

XML<endangered_species> <animal> <name>Tiger</name> <weight>500</weight> <subspecies> <name>Siberian</name> <region>Russia</region> <population>445</population> </subspecies> <subspecies> <name>Bengal</name> <region>India</region> <population>3159</population> </subspecies> </animal> <animal> <name>Black Rhino</name> <subspecies> <name>Southern Black Rhino</name> <region>Zimbabwe</region> <population>1365</population> </subspecies>

<subspecies> <name>Southwestern Black Rhino</name> <region>Namibia</region> <population>740</population> </subspecies> </animal></endangered_species>

endangered species

animalanimal

subspecies subspecies

name region population

siberian

445russia

name weight

tiger 500

The 'DOM' (Document Object Model) tree.

Page 20: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

20

Initial considerations

What tools do you need ?Will automating a task save time ?Where to use Style Sheets ?XML based Style Sheets:

Styles: 4st Action defaults: 4ad ToolBar: 4tb TopMenu: 4tm

Page 21: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

21

Technical Specifics

How to change an application's form filesOPEN WINDOWON ACTIONLocalized strings

Page 22: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

22

How to change an application's form file

• After

DATABASE standard

SCREEN{:: Ordinary Text, fields and arrays:}

ATTRIBUTES:INSTRUCTIONS:

SCHEMA standardLAYOUTVBOXGRID{:: Ordinary Text and fields:}END -- GRIDTABLE{:: Arrays - Single-line:}END -- TABLESCROLLGRID{:: Arrays - Multi-line:}END -- SCROLLGRIDEND -- VBOXEND -- LAYOUT

ATTRIBUTES:INSTRUCTIONS:

• Before

Page 23: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

23

DATABASE standard

SCREEN SIZE 20 BY 80{------------ Test Example ----------

Code...:[A0 ] Name...:[A1 ] Address:[A2 ] City-State-Zip:[A3 |A4|A5 ] Date...:[A6 ]

Contact Description[A7 ][A8 ][A7 ][A8 ][A7 ][A8 ][A7 ][A8 ]}

SCHEMA standard

LAYOUTVBOXGRID{ Test Example

Code...:[A0 ] Name...:[A1 ] Address:[A2 ] City-State-Zip:[A3 |A4|A5 ] Date...:[A6 ]}END -- GRIDTABLE{ Contact Description[A7 ][A8 ][A7 ][A8 ][A7 ][A8 ][A7 ][A8 ]}END -- TABLEEND -- VBOXEND -- LAYOUT

How to change an application's form file

SCREEN section

• After• Before

Page 24: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

24

How to change an application's form file

Tables section: Unchanged.Attributes section:

A0 = tsthead.ccode;A1 = tsthead.cname;A2 = tsthead.caddress;A3 = tsthead.ccity;A4 = tsthead.cstate;A5 = tsthead.czip;A6 = tsthead.cdate;A7 = tstdetl.ctype;A8 = tstdetl.cdescription;

ATTRIBUTESA0 = tsthead.ccode;A1 = tsthead.cname;A2 = tsthead.caddress;A3 = tsthead.ccity;buttonedit A4 = tsthead.cstate, image="gn_arrdn.png", action=ac_zoom;A5 = tsthead.czip";dateedit A6 = tsthead.cdate;A7 = tstdetl.ctype;A8 = tstdetl.cdescription;

Instruction section: Unchanged:Delimiters: Remove

buttonedit field:

dateedit field:

• After• Before

Page 25: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

25

How to change an application's form file

Problem areas:

What if:

Contact Description[A7 ] [A8 ]

One space

This results in:

The column heading should not be: 'Contact Description'. The rule is that at least two (2) spaces must separate column titles.

Page 26: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

26

How to change an application's form file

Fix 1: Two spaces

Contact Description [A7 ] [A8 ]

This results in the correct:

Fix 2: TABLE (WIDTH=46){ [A7 ][A8 ] [A7 ][A8 ] [A7 ][A8 ] [A7 ][A8 ]}:::A7 = tstdetl.ctype, TITLE="Contact";A8 = tstdetl.cdescription,TITLE="Description";

Page 27: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

27

How to change an application's form file

BUTTON Standard push button with a label or a picture.Replaces WIDGET="BMP"

BUTTONEDIT Line edit box with a button on the right side.Replaces WIDGET="FIELD_BMP"

CANVAS Area reserved for drawing.Replaces WIDGET="CANVAS"

CHECKBOX Boolean entry with a box and a text label.Replaces WIDGET="CHECK"

COMBOBOX Text edit box with a button that opens a list of values.Replaces WIDGET="COMBO"

DATEEDIT Line edit box with a button that opens a calendar window.EDIT Simple line edit box for data input or display.GROUP Attributes of a GROUP container specified with a layout tag.IMAGE Area where a picture file can be displayed.

Replaces WIDGET="IMAGE"LABEL Area reserved to display a value.PROGRESSBAR Progress bar widget to display an integer value.RADIOGROUP Field presented with a set of radio buttons.

Replaces WIDGET="RADIO"SCROLLGRID Attributes of a SCROLLGRID container specified with a layout tag.TABLE Attributes of a TABLE container specified with a layout tag.TEXTEDIT Multi-line edit box for data input or display.

Page 28: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

28

How to change an application's form file

sh =FORMONLY.shipto, widget="BMP", config="shipto.bmp Control-P";

BUTTON sh : ac_shipto, image="shipto.bmp";

• After

• Before

Page 29: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

29

OPEN WINDOW

open window w_shiptod at y_pos, x_pos with form "ship_oe" attribute (blue, border)

OPEN WINDOW w_shiptod AT y_pos, x_pos WITH FORM "ship_oe" ATTRIBUTES(TEXT="OE Shipto",STYLE="gn_main")

• After

• Before

Page 30: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

30

OPEN WINDOW

Previously the system-wide 'Style' 'Style sheet' was loaded with: CALL ui.Interface.loadStyles("gn_default") [gn_default.4st]

<Style name="Window.gn_main"> <StyleAttribute name="windowType" value="normal" /> <StyleAttribute name="startMenuPosition" value="menu" /> <StyleAttribute name="ringMenuPosition" value="bottom" /> <StyleAttribute name="ringMenuButtonSize" value="shrink" /> <StyleAttribute name="ringMenuButtonSpace" value="tiny" /> <StyleAttribute name="sizable" value="yes" /> <StyleAttribute name="hideToolBar" value="0" /> <StyleAttribute name="hideStatusBar" value="0" /> <StyleAttribute name="actionPanelPosition" value="bottom" /> <StyleAttribute name="position" value="center" /> <StyleAttribute name="statusBarType" value="lines2" /> </Style>

Page 31: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

31

ON ACTION

ON ACTION replaces ON KEY" and "ON COMMAND"

on key (control-p) CALL zmShipto()

ON ACTION ac_shiptoCALL zmShipto()

• After

• Before

Page 32: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

32

ON ACTION

A program-wide 'ToolBar' 'Style sheet' was loaded with: CALL fmMain.loadToolBar("gn_shipto") [gn_shipto.4tb]

<ToolBar name="custom" buttonTextHidden="1"> <ToolBarItem name="ac_shipto" image="gn_shipto.png" text="Ship To"/></ToolBar>

A program-wide 'TopMenu' 'Style sheet' was loaded with: CALL fmMain.loadTopMenu("gn_shipto") [gn_shipto.4tm]

<TopMenuGroup text="Custom"> <TopMenuCommand name="ac_shipto" text="Ship To" /></TopMenuGroup>

A program-wide 'Action Defaults' style sheet was loaded with: CALL fmMain.loadActionDefaults("gn_shipto") [gn_shipto.4ad]

<ActionDefaultList name="custom"> <ActionDefault name="ac_shipto" acceleratorName="Control-p"/></ActionDefaultList>

Page 33: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

33

Localized strings

Localized strings.

Form File[lb01]: [nm ]:LABEL lb01 : TEXT=%"lb_cust_name";

$ fglform -m test.per > test.str

CodeATTRIBUTES(TEXT=%"cust_maint",ERROR %"no_record"$ fglcomp -m test.4gl >> test.str

$ vi test.str"lb_cust_name"="Customer name""cust_maint"="Customer Maintenance Screen""no_record"="No record satisfies query"

$ fglmkstr test.str test.42s

Page 34: Migrating 4GL to Genero A Case Study Tom Smith Fourth Generation Software WAIUG/SEIUG Washington 2006

34

More info

For more info…[email protected]

www.fourthgeneration.com