将(单片)经典ASP迁移到ASP.Net(Migrate (monolithic) Classic ASP to ASP.Net)

编程入门 行业动态 更新时间:2024-10-26 01:32:40
将(单片)经典ASP迁移到ASP.Net(Migrate (monolithic) Classic ASP to ASP.Net)

多年来,我的目标是将ASP / VBScript转移到“更好”的语言 - 我的偏好是C#,因为我有C技能 - 但我也会考虑其他语言(包括PHP等,所以不仅仅是DotNet )

目标是使用一种语言为我们提供更多代码。 我讨厌在VBScript中缺少数据输入,我想要一些不同的“容器对象” - 而不仅仅是一个Dictionary对象,等等 - 事实上我想知道为什么,在80年代从Basic转移到C,然后C ++一段时间之后,我设法将“返回”移到了基本的00到00。

(我可以在VBScript中对容器对象进行编程,但我的直觉是它们在操作上会很慢;我们在页面渲染中使用了大量的HTML“片段”,ASP应用程序对象是一个非常钝的工具!)

我的ASP / VBScript是一个单独的大型应用程序,它基本上是一个提供Web内容的“引擎”。

它已经有很多年了,现在ASP代码很少变化。 (所以我确实需要证明移动它,或者只是“永远与VBScript一起生活”)

它是从MS SQL数据库中的数据驱动的。

只有一个.ASP页面(由几个包含文件组成)。

基于查询字符串参数,从数据库加载页面的Skin和CMS模板,运行合适的数据库Sprocs以获取合并到CMS模板中的数据。

还从数据库中检索有关页面的数据(使用方法等)以及访问权限等详细信息。

从我读到的一些内容可能会使迁移变得更容易:

不使用ASP会话 - 会话cookie用于从数据库中检索会话数据(因此我可以轻松地与ASPX共享会话一半)

VBScript始终使用OPTION EXPLICIT,因此所有变量都是预定义的。

所有输出都是通过Response.Write(实际上大多数内容合并为单个变量然后输出)。 没有HTML和<%服务器代码%>的混合。

我有一些VBScript类,但不是很多。

我有很多VBScript函数和一些子例程。

我有一个测试套件。 这会从浏览器中捕获屏幕截图并以图形方式将它们与主图像进行比较 - 因此我可以进行回归测试。

我没有足够的资源来完成重写; 在迁移过程中需要继续维护现有代码; 但是说我们99%的工作都在CMS或SQL Sprocs中,因此对ASP代码的更改很少。

我已经阅读了MS的实用程序,将ASP代码迁移到VB.NET。 鉴于我的代码是100%VBScript并且没有HTML / Script的混合我会欣赏这对我是否会帮助很多或者一点点的看法?

我很乐意重构STAYING IN VBscript,以便稍后更容易迁移到DotNet(但我需要知道我的目标是做什么:))。 例如,我可以将一些/所有函数移动到一个COM对象,并且可能会那么零碎地进行操作?

谢谢你的帮助

For many years I have had an objective of moving out of ASP/VBScript to a "better" language - my preference would be C# as I have skills in C - but I would consider other languages too (including PHP etc. so not just DotNet)

Objective is to have the code base in a language which does more for us. I hate the lack of data typing in VBScript, I would like a number of different "container objects" - rather than just a Dictionary Object, and so on - in fact I wonder why, having moved from Basic to C in the 80's, and then C++ a while after that, I managed to move "back" to Basic in to 00's.

(I could program the container objects in VBScript, but my instinct is that they would be slow in operation; we have a significant cache of "snippets" of HTML used in the rendering of the page, the ASP Application Object is a pretty blunt instrument!)

My ASP/VBScript is a single large application that is basically an "engine" to deliver web content.

It has been many years in the making, and now the ASP code changes seldom. (So I do need to justify moving it at all, or just living with VBScript "for ever")

It is driven from data in an MS SQL database.

There is only one .ASP page (made up of several include files).

Based on the query string parameters Skin and CMS templates for the page are loaded from database and suitable database Sprocs are run to acquire data which is merged into the CMS templates.

Data about the page (methods to use, etc.) is also retrieved from the database, along with details of access permissions and so on.

From what I have read some these things may make migration easier:

ASP sessions are not used - a session cookie is used to retrieve session data from the DB (so I could easily share a session half-and-half with ASPX

The VBScript uses OPTION EXPLICIT throughout, so all variables are predefined.

All output is via Response.Write (in fact most content is merged into a single variable and then output). There is no mix of HTML and <% server code %>.

I have some VBScript classes, but not many.

I have lots of VBScript functions, and a few Subroutines.

I have a test suite. This catches screen shots from the browser and graphically compares them with master images - thus I have the ability to do a regression test.

I don't have the resource to do a complete rewrite; maintenance of the existing code needs to continue during migration; but having said that 99% of our work is in CMS or SQL Sprocs, so the changes to ASP code are infrequent.

I have read of MS's utility to migrate ASP code to VB.NET. Given that my code is 100% VBScript and no mix of HTML/Script I would appreciate opinions on whether this would help me a lot or a little?

I would be happy to refactor STAYING IN VBscript with a view to making the migration to DotNet easier later on (but I'd need to know what my objectives were in doing that :) ). I could, for example, move some/all the functions to a COM object, and could probably do that piecemeal?

Thanks for your help

最满意答案

我有一个大型的ASP经典内联网,直到去年我都在维护,而且它已经老了,但是在ASP classic中仍然会添加新的内容,因为已经有很多库代码投入了。 如果您不经常更改ASP代码并进行某种形式的测试,那么您已经有了一个很好的设置。 (我必须承认这是我第一次听说过截图方法)。 如果一切都是从DataBase驱动并运行的话。 不要打破它。

PHP会给你同样的变体类型问题,但会给你一个选项和选择的世界,使ASP经典看起来像一个孩子的玩具。 开箱即用PHP做了我需要做的一切。

ASP.net是一个很大的框架。 正确而充分地理解它并不是一件容易的事,而且经常让我感到惊讶。 它试图为来自表单环境的开发人员做一些事情,当你来自一个非常精确的渲染方法,就像你听起来那样非常突兀。 我发现自己一直在与技术作斗争,直到ASP.net MVC出现。 它更符合我的想法,因为它的工作原理和做了我所要求的,仅此而已。 C#是一种非常棒的语言,具有出色的功能,如果您能找到合适的部分,DOT.net框架可以让您做任何事情。 有这么多你会发现自己偶尔会写一些已经在框架中完成的东西,只是在完成你自己的实现之后找到它。

实际上,迁移可能会导致一些有趣的问题。 即使你可以像ASP经典页面一样运行ASP.net页面,你也会失去环境的许多好处。 话虽如此,我确实做了一些测试,试图将有关网站迁移到ASP.net,并设法找到解决大多数绊脚石的方法,并得出结论,这样的迁移实际上只是“工作”。 尽管如此,这种迁移需要大量的工时才能使这项工作变得不可行。

我个人不会建议这样的迁移,除非你成功地拥有一些ASP.net项目,并且知道asp.net带来的陷阱。

我没有看到你说的ASP到ASP.net转换工具,但很想得到它的链接。

如果您在VBScript中停留并且不了解AX(ASP Xtreme Evolution)项目,我可以强烈建议您查看它的灵感来了解几个ASP经典“限制”以及它提供的功能库。

I have a large ASP classic intranet that I was maintaining until last year, and it was getting old, but new pieces were still being added in ASP classic because there was so much library code invested already. You already have a good setup if you are not changing the ASP code often and have some form of testing in place. (I have to admit it's the first time I have heard of the screenshot approach). If everything is driven off the DataBase and working. don't break it.

PHP will give you same problem of variant types, but will give you a world of options and choices that makes ASP classic seem like a childs toy. Out the box PHP does everything I've ever needed to do.

ASP.net is a BIG framework. Understanding it properly and fully is not an easy task, and it surprises me very often. it tries to do things for developers coming from a forms environment automatically that get very obtrusive when you come from a very precise rendering methodology like you sound you have. I found myself fighting the technology all the time, until ASP.net MVC came around. It fit my mind better because of how it worked and did what I asked it to, and nothing more. C# is an awesome language, with brilliant features and the DOT.net framework lets you do anything, if you can just find the right pieces. There is so much of it you will find yourself occasionally writing something that has been done in the framework already, only to find it just after finishing your own implementation.

Actually migrating could lead to some interesting problems. Even though you CAN run a ASP.net page much like an ASP classic page, you will loose many of the benefits of the environment as it is intended. That being said, I did do some test towards looking at migrating the site in question to ASP.net and managed to find ways around most of the stumbling blocks and reached the conclusion that such a migration would in fact be "mere work". The sheer quantity of man-hours it would take to do such a migration though made the undertaking infeasible.

Personally I would not suggest such a migration unless you have a few ASP.net projects under you belt successfully and are aware of the gotchas that asp.net brings with-it.

I have not seen the ASP to ASP.net conversion tool you speak of, but would love to get a link to it.

If you are staying in VBScript and are not aware of the AXE (ASP Xtreme Evolution) project here I can highly suggest looking into it for inspiration on getting past/around several of the ASP classic "limitations" and for the library of functionality it provides.

更多推荐

VBScript,ASP,电脑培训,计算机培训,IT培训"/> <meta name="description"

本文发布于:2023-08-06 11:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1448869.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:经典   ASP   Net   Classic   monolithic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!