1

将遗留的 PB 代码移植到 .NET 时代可能需要进行重大重构,才能正确完成工作。例如,我们的代码有一些 pre-userobject 遗留物,以及不推荐使用的特性,如 MDI、PBNI 等。我想知道在重构功能方面,我们将从 VS shell 获得多少帮助——将长函数分解为单独的,查找某个函数或事件的所有调用者等。

对于此类任务,经典的 IDE 非常糟糕。现在使用 VS 让他们更容易了吗?

4

1 回答 1

0

The answers to your questions are YES for the most part but not as cool as in Visual Studio. The PB IDE is night and day better than it was just not quite up to the full Visual Studio IDE.

PB does have some basic refactoring built in, for example something like a function rename across the entire project can be done easily. Here is the output generated when I renamed a function in one of my projects. And I had one of the files opened, the Visual Studio Shell detected it and asked me to reload the local file.

 Replace all "ConnectDB", "DBConnect", Subfolders, Find Results 1, "Entire Solution"
 H:\Dev\PBWS\pb_data.pbl\pb_data.sra(42,18):liRtn = gnv_data.DBConnect()
 H:\Dev\PBWS\pb_data.pbl\n_data_factory.sru(29,25):public function integer DBConnect ()
 H:\Dev\PBWS\pb_data.pbl\n_data_factory.sru(38,14):liRowCount = DBConnect()
 H:\Dev\PBWS\pb_data.pbl\n_data_factory.sru(103,25):public function integer DBConnect ();

 Total replaced: 4  Matching files: 2  Total files searched: 13

PowerBuilder 12.5.NET does have "Go To --> Definition" ability for jumping to function/class declarations. It isn't as cool as Visual Studio in that the PowerBuilder functions aren't as "open" as the .NET framework so you can't right click on GetItemString function and expect to see the internal declarations.

I haven't seen any impact analysis type features yet, like the ability to see where your functions are being called, but I haven't looked too hard yet.

On a positive note Sybase has incorporated the awesome intellisense / code completion of Visual Studio. It is responsive, accurate, and predictive much like when working in Visual Studio IDE doing C#. The PB.NET features along with nice stuff from Visual Studio Shell make PB development fun to work with again.

于 2011-10-09T14:35:51.813 回答