开发者

Does Powerbuilder 12 provide any refactoring capabilities?

开发者 https://www.devze.com 2023-04-12 05:57 出处:网络
Porting legacy PB code to the .NET era might require major refactoring, to get the work done properly. Our code, for instance, has some pre-userobject leftovers, as well as deprecated features such as

Porting legacy PB code to the .NET era might require major refactoring, to get the work done properly. Our code, for instance, has some pre-userobject leftovers, as well as deprecated features such as MDI, PBNI etc. I'm wondering how much help will we get from the开发者_如何学运维 VS shell when it comes to refactoring capabilities - breaking long functions into separate ones, finding all callers of a certain function or event etc.

The classic IDE is horrible for such tasks. Has using VS now made them easier?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消