Migrando VFP a .NET Tips y Sugerencias

Download Report

Transcript Migrando VFP a .NET Tips y Sugerencias

Migrating VFP to .NET
Suggestions and Tips
A migration experience in Costa Rica
Customs Office
Enrique Almeida – Concepto
[email protected]
Gustavo Morales – Costa Rica Customs Office
[email protected]
The Project
•
Customization of a system from Costa Rica real
life.
•
Concepto technological transfer to the Costa
Rica development team.
•
Migration of GeneXus 7.5 generating Visual
FoxPro (Windows) and C/SQL (Web and
WebServices) to GeneXus 8.0 and full .NET
•
400 Tables and 3200 objects
Who are we?
CONCEPTO
– 12 years working with GeneXus.
– GxAlliance members
– 2001 and 2002 Best BetaTester
– 2001 Early adopter of new
tecnologies .NET
– ISO-9001:2000 Quality System
Who are we?
COSTA RICA CUSTOMS OFFICE
- 650 employees.
- Invoicing
U$S 1,029,000,000
6% of Costa Rica GNP.
Why .NET and 3 Tier?
• Resolution of Costa Rica Ministry of
Finance
– Security
– Scalability
– Need for integration with other state
entities
– Conceived to keep the same
technology for the next 5 years
What did we have?
A working system developed with:
WIN
Visual Fox Pro
WEB
C/SQL
Client/
Server
Oracle
3 tier
SQLServer
And they requested us….
WIN
.NET
WEB
.NET
Changes in
• WIN and WEB generator
• Application architecture
• Database
Which implied the following additional updates
• GeneXus version (from 7.5 to 8.0)
• Data access (ODBC– ADO.NET)
Stages.
4
GeneXus 8.0
WIN
.NET
WEB
.NET
ADO.Net
3 tier
SQLServer
3
GeneXus 8.0
WIN
.NET
WEB
.NET
ADO.Net
Client/
Server
SQLServer
2
GeneXus 8.0
WIN
.NET
WEB
.NET
ODBC
Client/
Server
SQLServer
1
GeneXus 7.5
WIN
Visual Fox Pro
WEB
.NET
ODBC
Client/
Server
SQLServer
0
GeneXus 7.5
WIN
Visual Fox Pro
WEB
C/SQL
ODBC
Client/
Server
Oracle
Suggestion I:
Planning the migration!!
• Stages
– Simple and assessable steps
– If a problem arises it will be easily
detected and compared with
something that works correctly.
• Resources
– Defining the resources required for
each stage
Suggestion II:
Work group focused on the
migration
• Team working exclusively on the
migration
–
–
–
–
Anticipating problems
Evaluating new versions
Finding solutions to “standard” problems
Communicating solutions to the rest of the
work group.
• Rest of the group devoted to program
new features.
Suggestion III:
Studying destination platform
• If we will generate C#, someone in
the group must know how to
program C#.
• Build a “lab” with the destination
platform to perform tests and be
able to learn.
Suggestion IV: Deleting every
unnecessary thing
• Deleting everything that is not used !!
• Searching for every object nonreachable from mains and delete
them.
TIP I: How do you get the group
of objects used in your
application?
• Distributing:
– All transactions and Data Views
– All used mains (Easy in 8.0)
– All objects referenced by these mains
(ADD CALLED)
– All dynamically called objects
What problems may arise?
Study the KB searching for “weird things”
– External Programs and Stored Procedures
– Commands: “SQL”, “JAVA”, “DBASE”,
“CSHARP”, “VB”
– Non-STANDARD Functions
– DataViews with other databases
– Images/Already read files
– Components: ActiveX, DLL, etc.
– Calls between objects from different
generators/environments.
– DBF Tables
External Programs
• Rationalize their use
– Unify the ones doing similar things
– Verify if there is some GeneXus
function to do this
• Reprogram them in the new
language (C#)
• Test them in the new language and
platforms
TIP II – How can you see external
programs used in your KB?
External Programs
• In the migration to C# we had to
had parameters used by GeneXus
but not by the application.
• Different versions for
Windows/WEB, because of these
parameters.
Stored Procedures
• In ADO.NET, you must call SP with
the name of the parameter
variable.
• Change programming.
“DBASE” Commands
• Search for all objects that have DBASE
in the GeneXus code.
– Example:
DBASE wait window 'Presione <ESC> para cancelar' TIMEOUT 5
if lastkey()=27
&SALGO='S'
return
Endif
• This programming method should be
avoided.
• Substitute DBASE by CSHARP, and
program equivalent code.
TIP III: What objects use
DBASE command?
Suggestion V:
Use XPZ files (Distribute)
• Study distribution XML files format
(within XPZ)
• “Search and Replace” tool with regular
expressions
• Grep
• (SR) www.funduc.com.
– Use them to search for the objects
containing a specific string.
Functions
• Knowing the list of functions supported
in the destination platform.
• Detecting the non-supported functions
or the ones that have changed their
meaning in the destination platform.
• Searching for GeneXus Non-STANDARD
or non-native functions to find and
alternative for them.
TIP IV: How to find objects that
use non-standard functions?
• Consolidate it in an empty KB with the Function
property so that it will not accept non-standard
functions.
DESIGN
PROTOTYPE
• Review everything giving errors and warnings
• Correct them
Suggestion VI: Study all
Upgrades Release Notes
• Searching for corrected errors
• New features
• Changes in
–
–
–
–
Functions
Properties
Commands
Configuration
ActiveX Controls
• They are not supported in .NET
generator
• Reprogram them with native
controls
• Keep some programs in Visual
FoxPro.
Proposed Process
• Delete everything you do not need to
migrate
• Distribute original model
• Consolidate problems in empty KB and
solve them
• Specify problems and solve them
• Generate, compile and solve problems
• Compare execution with previous model
and fix differences
• Document errors and report them
Conclusions
• Migrating is unavoidable
• But……
– It takes work
– I takes planning
– It uses resources
• It allows the incorporation of new
features
Migrating VFP to .NET
Tips and Suggestions
Any question?
Enrique Almeida – Concepto
[email protected]
Gustavo Morales – Costa Rica Customs Office
[email protected]