Beruflich Dokumente
Kultur Dokumente
ASP
1) Use of migration tool defines most variables without a current definition as Object - not the best, but
does work
• Should we correctly define variables?
2) To enable better use of server side processing, should some of the pages be migrated to web forms?
3) Replace "include" files with vb code but not dlls?
4) Can we move any business logic in the asp pages into vb code?
5) Should we look to introduce any Ajax controls?
6) Should we look to incorporate any other specific .Net code features?
7) Should we use viewstate to maintain some state data in place of using hidden fields - this create its
own hidden fields!? Alternatives may be profile/cache.
8) How to manage session data - currently using session object.
9) Is there any impact on the way we do load balancing - especially with sticky sessions currently being
required.
• Understand what the migration tool does and list changes needed to .aspx pages to "rectify" situation.
"The following are the issues uncovered from the test migration:
1. Stargate ASP code has been structured in a specific way to enable common code to be extracted into
'include' files. These files contain utility functions. When the migration tool ran it was unable to
resolve the 'include' file references.
2. The migration tool should not be seen as providing a working solution. In fact this was far from so as it
changed some code that should not be changed.
3. The migration tool was a good starter, but even using that, the majority of the code needs to be
reviewed to check what it has done. Some common problems were seen and can be documented to
ensure that the code is then amended to correct this situation. Correction of these errors could then be
automated.
"
" As mentioned earlier, the ASP migration tool could not find the include files. Once the Visual Studio
website had been created, this became more of an issue. The error checking within Visual Studio would
often produce errors due to the 'complex' structure of includes used in Stargate. Includes are seen by many
as being an 'old fashioned' solution to providing common code. Several different approaches were
attempted to maintain the 'include' file approach, but they all had issues and did not resolve the Visual
Studio error checking approach.
This issue mainly affected the utility include files. The solution landed upon was to convert these include
files into functions within a new 'class' file. It is possible to do this and keep the separation of code as in the
existing utility include files.
• Variable declarations
"
Another issue was with variables declared in one file and expected to be present for use in another. This has
to be resolved to overcome the error in Visual Studio. There is no one correct answer, but a solution can
usually be found.
"
• JavaScript
"
A further issue discovered was around the javascript code. The current method of 'including' javascript files
did not work.
The javascript can be written in .aspx pages with a language statement of javascript1.2 and then included as
per normal includes.
<script language="JavaScript1.2">
This works, but it might not be the best solution. There are new facilities around javascript that could be
used, but time did not allow this to be fully investigated - e.g. use of page.?????????????????
"
"
Removed include of utilities.asp, secutil.asp, partutil.asp, workutil.asp, generateProduct.asp.
AddPartnerTags
Had to define the variable bCallCentre and add the code to set this variable.
If Len(CStr(utilclass.getCCNav)) = 0 Then
bCallCentre = False
Else
bCallCentre = True
End If
PageHeader/PageFooter
Both pages were amended to get them to work - variable definitions and moving some code!
I think we need to re-do the navigation process around current and previous page.
getdropdownlists
XML
Had to amnd path to XML by adding :18838/dotnet as the root path for VS debugging ???
QAS
Currently has Application.Lock() and Application.unlock() - these do not work in the .vb class used in
.NET?? look at other ways of achieving this.
RTEUtil
iPartnerId would normally be set somewhere in another include, but due to restructure as a .vb class then it
has to have code added to get the partner id.
iPartnerId = UtilClass.getPartner()
XML
Location of XML directory caused several problems - had to copy it into SGScripting/dll directory - not
sure what app.path was set to. (this was before trying to migrate any vb code).
"
COM Conversion
1) Review places where code is accessing external objects - should these be replaced by specific .NET
objects? What is the performance implication of using COM Interop?
• MSXML
• QAS
2) Multithreading is used by default - are all Stargate objects capable of multi-threading or should this be
turned off? If to be turned off then how to do it?
3) Make use of option strict on - this ensures all variables are defined
4) Implement IDisposable interface to ensure that objects are correctly disposed of in the code. Must set
objects to closed/nothing.
5) Fully qualify all types with complete namespace.
6) Where code has been replicated between objects as classes, create single DLL
Database access
.Net General
Other VB thoughts
First app migrated was SGDataSecurity - the only issue in migration was the strong naming. The migration
process tried to add a strong name and generated a .snk file. This was resolved by commenting out the
strong name in the assemblyinfo.vb file and building from there (also ran sn -Vr, but this appeared to fail,
so ran -Vu which also appeared to fail - will need to check this on the next dll!). There is also a property
page around strong name.
Other things tried was using sn to generate a public/private key pair (-k to generate the public/private key
pair and -p to then extract the public key).
The asp code had to be changed to remove the createobject and use xxxx = new sgdatasecurity.security()
(being the class of the object). Also added an import statement, but don't think this was necessary.
Changed the function to return an sgdatasecurity.security rather than a generic object - this is more efficient
and should be replicated through the asp code!! i.e. all definitions of the object should be replaces with dim
xxxx as sgdatasecurity.security
Second project migrated was SGUtilityEvent. Same issue with strong names as for the first application.
Tried adding name in assemblyinfo.vb as:
<Assembly: AssemblyKeyFile("c:\stargate\dotnet\stargatepubpri.snk")>
then ran sn -Vr to avoid verification. This worked. The ran sn -Vx to
remove all strong name verification and both still worked! Checked back
on previous project and found the snk line commented out, so tried to
comment it out and re-build. This now failed on loading SGUtilityEvent
as it was not strong named. Found that the properties page of the
previous project had the signing check box ticked and the snk file
selected, so repeated for SGUtilityEvent and then tested - this now
worked.
Left an error in the code and traced through to event logging - this
would appear to cause a problem and left the system hanging - the first
issue was around the parameter to copymem - the two "as any"s needed to
be replaced with integer and string. The hang appeared to happen on the
End Sub!
If Not System.Diagnostics.EventLog.SourceExists(strEventSource)
Then
System.Diagnostics.EventLog.CreateEventSource(strEventSourc
e, "Application")
End If
End Sub
End Sub
' DeregisterEventSource(lngEventLogHandle)
End Sub