从ASP经典移植到.NET和缓解疼痛 [英] Migrating from ASP Classic to .NET and pain mitigation

查看:131
本文介绍了从ASP经典移植到.NET和缓解疼痛的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正处在重新设计的.NET 3.5面对我们网站的部分顾客的过程。它进展顺利,到目前为止,我们使用相同的工作流,并在大多数情况下的存储过程,最大的变化是用户界面的ORM(从字典到LINQ),明显的语言。大部分的网页这一点已经微不足道,但我们现在最重的工作流程页面的工作。

We're in the process of redesigning the customer facing section of our site in .NET 3.5. It's been going well so far, we're using the same workflow and stored procedures for the most part, the biggest changes are the UI, the ORM (from dictionaries to LINQ), and obviously the language. Most of the pages to this point have been trivial, but now we're working on the heaviest workflow pages.

我们的报价接受部分的主要页面是1500线,大约90%是ASP,可能有另外1000线函数调用包括。我觉得1500线是有点自欺欺人过,因为我们有这样的宝石工作

The main page of our offer acceptance section is 1500 lines, about 90% of that is ASP, with probably another 1000 lines in function calls to includes. I think the 1500 lines is a bit deceiving too since we're working with gems like this

function GetDealText(sUSCurASCII, sUSCurName, sTemplateOptionID, sSellerCompany, sOfferAmount, sSellerPremPercent, sTotalOfferToSeller, sSellerPremium, sMode, sSellerCurASCII, sSellerCurName, sTotalOfferToSeller_SellerCurr, sOfferAmount_SellerCurr, sSellerPremium_SellerCurr, sConditions, sListID,  sDescription, sSKU, sInv_tag, sFasc_loc, sSerialNoandModel, sQTY, iLoopCount, iBidCount, sHTMLConditions, sBidStatus, sBidID, byRef bAlreadyAccepted, sFasc_Address1, sFasc_City, sFasc_State_id, sFasc_Country_id, sFasc_Company_name, sListingCustID, sAskPrice_SellerCurr, sMinPrice_SellerCurr, sListingCur, sOrigLocation)

我一直使用至今的标准做法是,也许要花一个小时左右阅读过的应用程序既可以自己熟悉它,而且要去掉注释掉/德precated code 。然后,在深度优先的方式工作。我将开始在顶部,并在aspx.cs文件复制code的一个片段,并开始改写,使得明显重构,我去特别是利用我们的ORM的优势。如果我得到一个函数调用,我们没有,我会写出来的定义。

The standard practice I've been using so far is to spend maybe an hour or so reading over the app both to familiarize myself with it, but also to strip out commented-out/deprecated code. Then to work in a depth-first fashion. I'll start at the top and copy a segment of code in the aspx.cs file and start rewriting, making obvious refactorings as I go especially to take advantage of our ORM. If I get to a function call that we don't have, I'll write out the definition.

在我所拥有的一切codeD我会在重构/测试做了几个通行证。我只是想知道如果任何人有关于如何使这个过程中的任何提示,更容易一点点/更高效。

After I have everything coded I'll do a few passes at refactoring/testing. I'm just wondering if anyone has any tips on how to make this process a little easier/more efficient.

推荐答案

相信我,我知道的究竟的你在哪里..我目前正在迁移大型应用程序来从ASP经典到.NET ..和我仍然在学习ASP.NET! :S(!是的,我吓坏了)

Believe me, I know exactly where you are coming from.. I am currently migrating a large app from ASP classic to .NET.. And I am still learning ASP.NET! :S (yes, I am terrified!).

我一直在我的脑海中主要的事情是这样的:

The main things I have kept in my mind is this:


  • 我不流浪的的从目前的设计远(即没有大规模的让撕裂这一切出来,并使其ASP.NET神奇!)由于令人难以置信的高量耦合的ASP经典往往有,这将是非常危险的。当然,如果你有信心,填写你的靴子:)这可以在以后重构。

  • 返回的一切了测试,测试和更多的测试!我真的很努力地进入TDD,但其很难测试现有的应用程序,所以每次我删除经典的一大块,用.NET替代,我保证我有尽可能多的绿色光测试支持我越好。

  • 研究了很多,也有经典和.NET,有时什么都可以code的多条线路,包括经典的可在code几行实现之间的一些重大变化,认为编码..我这学到了艰辛的道路,前几次的:D

  • I dont stray too far from the current design (i.e. no massive "lets rip ALL of this out and make it ASP.NET magical!) due to the incredibly high amount of coupling that ASP classic tends to have, this would be very dangerous. Of course, if you are confident, fill your boots :) This can always be refactored later.
  • Back everything up with tests, tests and more tests! I am really trying hard to get into TDD, but its very difficult to test existing apps, so every time I remove a chunk of classic and replace with .NET, I ensure I have as much green-light tests backing me as possible.
  • Research a lot, there are some MAJOR changes between classic and .NET and sometimes what can be many lines of code and includes in classic can be achieved in a few lines of code, think before coding.. I've learnt this the hard way, several times :D

它非常喜欢打积木与code:)

Its very much like playing Jenga with your code :)

祝您好运与项目,更多的疑问,那么请询问:)

Best of luck with the project, any more questions, then please ask :)

这篇关于从ASP经典移植到.NET和缓解疼痛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆