Mitigating the issue of name hiding.
缓解名称隐藏问题。
Listing 4 illustrates the hiding of customer name, street, zip code, and phone number from software that accesses the XML through the anonymousCust view
清单 4 演示了如何通过 anonymousCust 视图对访问 XML 的软件隐藏客户姓名、街道、邮政编码和电话号码
Although you should avoid name hiding (giving local variables the same names as attributes), the use of accessors to always access attributes means you can give local variables any name you want.
虽然应该避免名称隐藏(为本地变量赋予与属性相同的名称),但是始终使用读写方法来访问属性意味着:可以为本地变量赋予任何名称。
应用推荐