1

所以,几周前我刚刚开始了一份新工作。这是我做软件的第一份工作,我的任务是学习一个巨大的项目是如何工作的。现在,我之前的那个人在源代码的任何地方都没有留下任何(zilch)文档或注释。此外,他基本上应用了 Gamma 等着名的设计模式书中的每一种设计模式......

我的问题是,我该如何开始?我已经尝试为我想学习的某些调用设置断点(一点一点地学习),但是由于使用了 500 万种设计模式,每次调用都会上升大约 7 个级别才能完成,到那时,很难保持跟踪正在创建和使用的 20 个对象。

有没有人有类似的经历?关于尝试不同方法的一些指示?

规格:语言 - VB.net
IDE - Visual Studio 2010
使用 - Windows Forms
Brain - Melting

4

1 回答 1

1

Inheriting a large project without documentation is always a huge pain in the ass. I hope you have already accustomed your manager to the inconvenient truth that it will take several weeks or even months until you can maintain that project efficiently.

I would start with creating some UML class diagrams. That could tell you a lot about how the system works and which design patterns are used where.

While doing so, I would also add comments to the code with everything I learned about it. When I am not sure if I understood what the code does correctly, I would add a common string like "NOT_SURE" to the comment. Later, when I have a better understanding of the system, I could use a text search to find and revise these comments.

于 2012-12-19T15:58:49.177 回答