难道这就是"十分之一的"时间重写?这就是、重写、时间、QUOT

2023-09-03 10:08:33 作者:我的世界不能没有你

我是非常反对重写应用程序,如果它是可以避免的。据我所知,9次了10年,它的更好重构规则,但我在的情况下它可能是一次十,我期待找到该行。

现在的情况是:

在我接手一个VB6 / SQL应用程序的维护。 的code的总线条75-100k(code-屁股,模块和类)。 在最初的开发者离开了,所以这只是我,而且也没有机会扩大队伍,至少几年的时间。 在没有任何架构的程序(形式为code-屁股纯文本只是直接的SQL调用)。 在不尝试按照干或OAOO原则。 在数据库有一些主键,但没有外键。 在这个系统已经到位,一切都在大S preadsheets管理,所以这个系统确实是一个巨大的改进,他们有什么,但不会做他们预想的东西。 在我能自己写一些工具来代替表名和列名的所有文字实例与常数,并期待起坐,我写了一个快速code根脚本生成这些常数,并期待起坐从数据库,所以现在我可以放心地进行数据库的变化,看到到处爆发。我已经开始正常化数据库在边缘,但它像的存在方式3%。 有没有单元测试,所以我每次更改数据库,我基本上已经重写任何逻辑在它上面坐着,我用的是两个版本的比较功能,并确保它是相同的。到目前为止好。 在我开始只是想修补关键漏洞止血,我可以有把握地说,这主要是做了,所以现在我退一步一会儿看大图。 在管理的支持和合理的期望。 的长期目标是把它反正到.NET ...

所以,我权衡这些选项:

继续正常化的数据库,修改VB6的应用程序,因为我去(最终被一块一块地重写) 把VB6的一进一出仅维护状态(没有新功能),选一个功能模块的时间和重写部分在.NET上的标准化数据库结构之上。

我的想法是,如果我选择选项1,然后在最后我只是有一个VB6应用程序,他们仍然想升级到.NET,我已经研究过这一点,它的昂贵和费时,甚至与这些工具,你还是会得到的东西,是一个有点怪人。如果我去与选项2,我相信我能越早做,我会直接跳到目标的技术。

在我在我的正常化进程已经改写了规模小件,结果是在什么已经在那里了一种改进的模块,所以在改写过程中被增值。

现有的应用程序,其所有缺点,是一个伟大的谈论的焦点进行讨论。使用它的人能告诉我什么是为他们工作,什么不是,所以肯定是一个很大的价值存在的方式。

那么,这是否有资格作为其中的一个十分之一时代,还是不?

解决方案

我最初写在VB6项目,他们聘请我将其转换为.NET 。我最近离开那份工作。我相当确信,该计划可能不应该被改写。

下面的一些因素,如果你把重新写入的方式考虑(根据我的项目)

这不会是一个直的重写。一旦字失控的得到重新编写新的功能要求会弹出会有重新设计的相当数量/重新架构 在人们不会接受仅维护模式出了很多阻力第一。有一段时间,每一个错误将是关键任务 移植一个VB6应用程序到.NET不应该被看作是更容易比C ++应用到.NET移植,或哈斯克尔项目.NET。有一些共同性,但最后,这是一个99%的不同code基(对现有公式可能1%) 假设这个计划是在生产中(即使是内部的)你​​的新方案将很可能不会达到,至少在最初阶段。你会听到但是在旧的方式...或过去...... 假设你的客户是不是其他的IT人,他们不会明白: 什么是这么长时间 旧的; 为什么它不只是像程序(感觉在外观和AMP) 虽然目前的应用程序是随着时间的推移发展,它可能会预见的是,你的应用程序将具有的功能,100%上线,并在更短的时间。

这些都是从现实生活中的迁移从VB6到.NET的所有经验。我是唯一的.NET开发人员。有没有能力聘请额外的帮助。我的情况和你之间的主要区别是1。原开发商还在那里 - 只是在一个新的角色(有时更困难吧)2.原应用程序并不需要大量的bug修复

我想,如果我有它做一遍,我会尝试创造一些.NET的DLL并把那些在VB6应用程序。一片片转换为.NET。因此,也许您将数据和业务逻辑的应收账款到.NET。所有的其它方面保持不变。图形用户界面,再经过多数民众赞成推出,并标记为已完成的其他功能等,采取对航运部分,做同样的事情。最后一步是创建一个使用你的DLL的一个新的.NET GUI。

沪媒 申花卖球员收获超3000万 板凳深度严重不足

这给你一对夫妇的好处

在最终的应用程序是用.NET 允许您慢慢铺开更改。你会不会调试运费和应收账款和人力资源等全部在同一时间的上线的一周 让您使用更现代的工具,不破坏整个计划。想用NHibernate的,PLINQ或MEF?做一个模块的时间。学习的工具,并小步 允许在图形用户界面的灵活性。最后,你可以做的WinForms,WPF或Web项目,都利用自己的核心动态链接库。 在不抛出一吨的变化,在用户的一次。你重新写了应收账款部分和用户没有头绪,因为图形用户界面是一样的。然后,当你推出的图形用户界面,你知道你的后端的工作。 将使得未来的重构变得容易。你已经分解项目成一口大小的块。您可以进一步对他们的工作,他们知道什么影响等。

我会很疲惫​​的决定作为一个开发人员重新编写该应用程序,并提供他们工作的产品。我觉得,一个保守的估计(假设没有范围蔓延等)将是24个月。也许更可能3 - 4年。

我离开这个项目已经制作了3年,是servicable,但还不是100%替代原有的应用程序。就像我说的...即使这将意味着我没有工作,我不认为它应该被重新写入。

I'm very much against rewriting an application if it can be avoided. I understand the rule that 9 times out of 10, it's better to refactor, but I'm in a situation where it might be the one time in ten, and I'm looking to find that line.

The current situation is:

I took over the maintenance of a VB6/SQL application. The total lines of code is 75-100k (code-behinds, modules, and classes). The original developer left, so it's just me, and there's no opportunity to expand the team, at least for a few years. There was no architecture to the program (just straight SQL calls in plain text in the form code-behinds). Doesn't try to follow the DRY or OAOO principles. Database had some primary keys, but no foreign keys. Before this system was in place, everything was managed in big spreadsheets, so this system really is a huge improvement over what they had, but doesn't do what they're envisioning. I was able to write myself some tools to replace all literal instances of table names and column names with constants and look-ups, and I wrote a quick code gen script to generate those constants and look-ups from the database, so now I can safely make database changes and see everywhere that broke. I have started normalizing the database "around the edges", but it's like 3% of the way there. There are no unit tests, so every time I change the database, I basically have to rewrite whatever logic sits on top of it, and I use the two versions to compare functionality and make sure it's the same. So far so good. I started by just trying to fix critical bugs to stop the bleeding, and I can safely say that's mostly done, so now I'm stepping back for a moment to look at the big picture. Management is supportive and reasonable in their expectations. The long-term goal is to convert it to .NET anyway...

So, I'm weighing these options:

Continue normalizing the database and modifying the VB6 app as I go (ends up being a piece by piece rewrite) Put the VB6 one into a maintenance-only state (no new features), pick one functional module at a time and rewrite that part in .NET on top of a normalized database structure.

My thought is that if I choose option 1, then at the end I just have a VB6 app that they still want to upgrade to .NET, and I've looked into that and it's costly and time consuming, and even with the tools you'll still get something that's somewhat of a Frankenstein. If I go with option 2, I believe I can be done sooner, and I'll jump right to the target technology.

In the small scale pieces that I've already rewritten during my normalization process, the result has been an improved module over what was already there, so there is value being added during the rewrite.

The existing app, for all its flaws, is a great talking point for discussion. The people using it can tell me what's working for them and what isn't, so there's certainly a lot of value there that way.

So, does this qualify as one of those "one in ten" times, or not?

解决方案

I had a project that was originally written in VB6 and they hired me to convert it to .NET. I recently left that job. I'm fairly convinced that the program probably shouldn't have been rewritten.

Here's some factors to consider if you take the re-write approach (based on my project)

It will not be a straight rewrite. Once word gets out its getting re-written new feature requests will pop up and there will be a fair amount of redesign/re-architecting People will not accept the "maintenance-only" mode with out a lot of resistance first. For a while, every bug will be "mission critical" Porting a VB6 app to .Net should NOT be viewed as easier than porting a C++ app to .Net, or a Haskell project to .Net. There is some commonality, but in the end, it's a 99% different code base (possible 1% for existing equations) Assuming this program is in production (even internally) your new program will very likely not measure up, at least initially. You'll hear "But in the old way..." or "It used to..." Assuming your customers are not other IT people, they WILL NOT understand: What is taking so long Why it isn't just like the program (in look & feel) of the old one While the current app was developed over time, it will likely be expected that your app will have 100% of the functionality on go-live, and in less time.

Those are all experiences from a real life migration from VB6 to .Net. I was the only .Net developer. There was no resources to hire additional help. The main differences between my situation and yours is 1. the original developer was still there - just in a new role (making it harder at times) and 2. The original app didn't need a lot of bug fixes.

I think if I had it to do all over again, I would try to create some .NET dlls and incorporate those in the VB6 app. Piece by piece converting to .net. So perhaps you move the data and business logic for Accounts Receivable to .NET. All the other aspects stay the same. The GUI, the other features etc. Then after that's rolled out and marked as complete, take on the Shipping section and do the same thing. The final step is to create a new .NET GUI that uses your DLLs.

This gives you a couple benefits

In the end the application is written in .NET Allows you to slowly roll out your changes. You won't be debugging shipping and accounts receivable and hr etc all at the same time the week of "go-live" Allows you to use more modern tools without wrecking the whole program. Want to use NHibernate, PLINQ or MEF? Do it one module at a time. Learn the tool and make small steps Allows for flexibility on the GUI. In the end, you could do WinForms, WPF or a Web project, all utilizing your core DLLs. Doesn't throw a ton of changes at the user all at once. You've re-written that accounts receivable portion and the user has no clue, because the GUI is the same. Then when you roll out the GUI, you KNOW that your backend is working. Will make future refactoring easier. You've already broken down your project into bite-size chunks. You can further work on them knowing what they effect etc.

I would be VERY weary of deciding as a single developer to re-write this application and deliver them a working product. I think a conservative estimate of that (assuming no scope creep etc) would be 24 months. Probably more likely 3-4 years.

The project I left had been worked on for 3 years and was servicable, but was not yet a 100% replacement for the original app. Like I said... even though it would have meant me not having a job, I don't think it should have been re-written.