本文介绍的最后一个重构方法也是最难以使用的方法:Change Method Signature(改变方法的签名)。这种方法的功能显而易见——改变方法的参数、可见性以及返回值的类型。
基于8个网页-相关网页
本文介绍的最后一个重构方法也是最难以使用的方法:Change Method Signature(改变方法的签名)。
The final refactoring considered here is the most difficult to use: Change Method Signature.
如果您想改变方法签名或者添加一个方法,您要修改您的插件程序的源代码,但是一旦您将其保存您必须重新构建您的JAR文件。
If you want to change a method signature or add a method, you modify the source, but once you save it you must rebuild your.JAR file.
在面向对象设计中,传递对象通常能提供较好的封装,因为对象字段的变化不需要改变方法签名。
With object-oriented designs, passing the object often provides better encapsulation, in that changes in the object fields don't require changes to the method signature.
应用推荐