Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences
-
Upload
vb-migration-partner -
Category
Technology
-
view
1.348 -
download
6
Transcript of Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences
![Page 1: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/1.jpg)
Francesco Balena – Code Architects, Italy
VB6 Migration:Myth, truth, and real-world experiences
![Page 2: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/2.jpg)
Me.About the Programming Microsoft
Visual Basic series
MSDN Regional director, Italy
VB Migration Partner
www.vbmigration.com
![Page 3: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/3.jpg)
Code Architects Visual Studio Industry Partner (VSIP)
the only Microsoft ISVNXT partner specialized in conversion and modernization of VB6 apps
customers in Europe, United States & Canada, Australia and Asia
dozens of millions of lines of code migrated
official Microsoft Case study published on Microsoft.com, ERP system of about 1M lines of code
![Page 4: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/4.jpg)
glossaryconvert or migrateport & extendrewrite
“language impedance”functional equivalencestaged (phased) migrations
![Page 5: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/5.jpg)
myth
automatic migration tools can’t really handle the complexity of VB6
![Page 6: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/6.jpg)
“language impedance” data types type-char suffix Array lower bounds Optional params As New variables Byval argument passing Defxxx array rank missing As As Any parameters block variables date as double array assignments callbacks in Declare As New arrays UDT initialization Variants default parameterless members Gosub On Goto/GoSub Byref ParamArray Fixed-length strings UDT assignments byte-oriented string functions enum/number conversions IsMissing Empty value Null propagation VarPtr, ObjPtr, StrPtr class termination IDisposable objects default members in late-binding OLE control Line and Shape controls control arrays graphic methods ScaleMode property DrawMode property DAO and RDO data-binding ADO data-binding ADO data-bound classes DataEnvironment VBControlExtender object PropertyPages UserDocuments “classic” drag-and-drop OLE drag-and-drop Extender and Ambient properties DDE WebClasses DHTML Pages Sub Main in DLLs SingleUse classes Global classes COM+ components class persistence Print and Printers App, Screen, Forms objects ActiveX EXEs popup menus
![Page 7: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/7.jpg)
“language impedance” (UW) data types type-char suffix array lower bounds Optional params As New variables Byval argument passing Defxxx array rank missing As As Any parameters block variables date as double array assignments callbacks in Declare As New arrays UDT initialization Variants default parameterless members Gosub On Goto/GoSub Byref ParamArray Fixed-length strings UDT assignments byte-oriented string functions enum/number conversions IsMissing Empty value Null propagation VarPtr, ObjPtr, StrPtr class termination IDisposable objects default members in late-binding OLE control Line and Shape controls control arrays ScaleMode property DrawMode property DAO and RDO data-binding ADO data-binding ADO data-bound classes DataEnvironment VBControlExtender object PropertyPages UserDocuments “classic” drag-and-drop OLE drag-and-drop Extender and Ambient properties DDE WebClasses DHTML Pages Sub Main in DLLs SingleUse classes Global classes COM+ components class persistence Print and Printers App, Screen, Forms objects ActiveX EXEs popup menus
![Page 8: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/8.jpg)
“language impedance” (VBMP)
data types type-char suffix array lower bounds Optional params As New variables Byval argument passing Defxxx array rank missing As As Any parameters block variables date as double array assignments callbacks in Declare As New arrays UDT initialization Variants default parameterless members Gosub On Goto/GoSub Byref ParamArray Fixed-length strings UDT assignments byte-oriented string functions enum/number conversions IsMissing Empty value Null propagation VarPtr, ObjPtr, StrPtr class termination IDisposable objects default members in late-binding OLE control Line and Shape controls control arrays graphic methods ScaleMode property DAO and RDO data-binding ADO data-binding ADO data-bound classes DataEnvironment VBControlExtender object PropertyPages UserDocuments “classic” drag-and-drop OLE drag-and-drop Extender and Ambient properties DDE WebClasses DHTML Pages Sub Main in DLLs SingleUse classes Global classes COM+ components class persistence Print and Printers App, Screen, Forms objects ActiveX EXEs popup menus
![Page 9: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/9.jpg)
truth
rewriting from scratch can deliver the best quality code
( sad but true )
![Page 10: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/10.jpg)
myth
rewriting from scratch always delivers the best quality code
![Page 11: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/11.jpg)
truth
the sooner we start, the better
![Page 12: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/12.jpg)
myth
the sooner we start, the better, therefore let’s run the Upgrade Wizard, remove all compilation errors, debug the .net code, do some tests, fix bugs, polish the UI, create the setup, write the manual, and tell the boss we’re ready to ship
![Page 13: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/13.jpg)
myth
nearly all migration projects fail miserably
![Page 14: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/14.jpg)
truth
nearly all migration projects fail miserably if they weren’t planned accurately
( like any software project... )
![Page 15: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/15.jpg)
what you need, what you have• a goal
– what goes to .NET, what stays in VB6– architectural changes– target language, 3rd-party controls
• a migration tool (if any)• a deadline• a team
– VB & .NET expertise, familiarity with the code base, migration skills
![Page 16: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/16.jpg)
the assessment step VB6 to VB.NET Upgrade Assessment Tool
http://www.microsoft.com/downloads/details.aspx?FamilyId=10C491A2-FC67-4509-BC10-60C5C039A272&displaylang=en
VB6 Code Advisorhttp://msdn2.microsoft.com/en-us/vbrun/
ms789135.aspx VB6 Bulk Analyzer
http://www.vbmigration.com/Resources/VB6Analyzer.aspx
look at estimations with great suspect always prepare a Proof-of-Concept
![Page 17: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/17.jpg)
truth
all .NET language are equally powerful, therefore it doesn’t really matter which language we select for our software projects
![Page 18: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/18.jpg)
myth
all .NET language are equally powerful, therefore it doesn’t really matter whether we select VB.NET or C# in our migration projects
![Page 19: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/19.jpg)
VB.NET challenges
• Variants• Null propagation in expressions• ActiveX EXE components• Gosub, VarPtr, StrPtr, ObjPtr
![Page 20: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/20.jpg)
C# challenges
• Variants• Null propagation in expressions• ActiveX EXE components• Gosub, VarPtr, StrPtr, ObjPtr• optional parameters (fixed in 2010)
• late binding (almost fixed in 2010)
• error handling
![Page 21: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/21.jpg)
C# challengesOn Error Resume NextDoSomething(x)If CheckExpr(x) Then DoSomethingElse(x)
try { DoSomething(x); }catch (Exception ex) { SetError(ex); }bool test;try { test = CheckExpr(x); }catch (Exception ex) { SetError(ex); }try { if (test) DoSomethingElse(x); }catch (Exception ex) { SetError(ex); }
![Page 22: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/22.jpg)
myth (revised)
all .NET language are equally powerful, therefore it doesn’t really matter whether we select VB.NET or C# in our migration projects
...unless you are paid by the hour
![Page 23: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/23.jpg)
myth
migrated code runs slower than hand-written code
![Page 24: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/24.jpg)
(half) truth
migrated apps should never use a support library
![Page 25: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/25.jpg)
myth
migrated apps must never, ever use a support library
![Page 26: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/26.jpg)
a support library can
• dramatically reduce compile and runtime errors
• closely mimic VB6 behavior and UI• hide the complexity of .NET• produce concise and neater code• optimize your app for size/speed• simplify bug fixes• offer interoperability with VB6 apps• ... (read more reasons here)
![Page 27: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/27.jpg)
VB6 migration: myth, truth, and real-world experiences knowledge base, videos, code samples,
articles, links, and resources atwww.vbmigration.com
slides available atwww.slideshare.net/VBMigrationPartner
blogwww.vbmigration.com/blog
LinkedIn Group on VB6 Migrationwww.linkedin.com/groups?gid=3074090
Facebook Fan Page on VB6 Migrationfacebook.com/FrancescoBalenaOnVB6Migration
![Page 28: Basta! 2010 - VB6-to-NET Migration: Myth, Truth, and Real-World Experiences](https://reader030.fdocuments.us/reader030/viewer/2022032700/55d56b99bb61eb256e8b4738/html5/thumbnails/28.jpg)
Get free advice Each VB6 application is different and
creates unique challenges in the migration to .NET.
To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file.
You will receive a detailed report on your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.www.vbmigration.com/getfreeadvice.aspx