软件工程Visual Studio 2005实现VB重构英文文献及翻译
in Visual studio 2005 to achieve VB reconstruction
Abstract: according to Martin Fowler’s explanation,reconstruction is a inner structure of updating code and construction method without changing outer behavior,Visual Studio.NET 2005 support C# restruction,this article mainly explains something about the topic”in Visual studio 2005 to achieve VB reconstruction”.
•1 Introduction
Two reasons for making Visual Basic extremely popular:VB6 programmer and oop programmer.For one thing, VB6 programmers want to make VB indeed easy to use,for another oop programmers think that VB should become a powerful language like C# or C++ or else VB is just a toy.It’s not possible that VB is only amateur’s language,of course in the meanwhile it isn’t also completely meaningful language of object-oriented and Microsoft company won’t count what kinds of users should be satisfied.So nowadays,VB are trying to satisfy both of demands mentioned above.For example,原文请找腾讯752018766辣-文^论-文.网http://www.751com.cn customizable characterstic attracts VB6 programmers and appending operator overloading appeal to oop programmer.However,Microsoft company admits that excluding VB reconstruction about IDE is a negligence. Therefore, after that they develop Refactor for VB and freely downloading. What is reconstruction?according to Martin Fowler’s explanation,reconstruction is a inner structure of updating code and construction method without changing outer behavior.(Martin Fowler appeal to people for paying attention to reconstruction use in public,William Opdike is considered to be inventer of reconstruction.)
What point of view I should hold? Toy language is used by toy makers. Toy makers have their own market(especially the Christmas occasion),but I have realistic business logic to solve and be able to use commercial tool to create toys instead of the toy establishing commercial tools.
You would not agree with me but you should know reconstruction because even for the a little modified application program,it will become very complicated. Reconstruction is a operated by the settled rules method which recovers present code without changing behavior. Modifying structure and mataining behavior are the key principles of reconstruction.
• 2 the reasons for reconstruction
Reconstruction enables to guide you to cross ”not complicated” code and continuously breaks down or alters the code. Every reconstruction has clear motivation and uses a serials of steps to show how to finish reconstruction and the expected outcome. Some reconstructions base on modern technique,and the others are based on new ones. However all the reconstructions are named and clearly set up files.
A common reconstruction instance is encapsulating field. Encapsulating field means fetching public variables and making them become private variables,then provides accession to them through funcations. The reconstruction is bulit so well that it has become fashionable property. In other words, although common people always avoid the programming practice,some programs still use public fields.
Visual Studio.NET 2005 supports C# reconstruction but VB.NET 2005 doesn’t. Nevertheless, as a result of Refactor occurrence, the present VB developer needn’t to programming their own reconstruction tools. As for Visual Basic, you can freely download the tool from Microsoft website. Although you can manually implement any reconstruction,the present tool make them easier,simpler and quicker,what’s more,their use are very interesting.
The rest of the article will show how to use Refactor to achieve three reconstructions! In Visual Basic.Net 2005 version 1.0.31,there are three conditions:Encapsulate fields,Extract Method,Create Overload.
• 3 Encapsulate fields
Reconstructon is a define process which can improve code’s achievement of quality. In detail,reconstructon based on the constant software changes,improve software quality and property through adjusting program code to make program design’s module and structure more reasonable,in the meanwhile,improve software’s expansibility and maintainability. In the simpliest sense, reconstruction extract some subjectivity from codes. As software engineers, we needn’t to depend on consensus and perseverance to judge whether the codes are good or not, we can apply a objective standard and agree that reconstruced codes are more advanced than non-reconstructed ones. Like design mode, reconstruction is named code mode with enough descriptions,commands and expected outcomes. Any programmers,no matter whether he is experienced or not, can read corresponding descriptions, use predetermined commands like following doctor’s prescription and make some expected progresses.1665