方法重载 - 好的或坏的设计? [英] Method overloading - good or bad design?

查看:159
本文介绍了方法重载 - 好的或坏的设计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢重载方法,以支持越来越多的拖欠还款个案。什么是方法重载的性能影响?从你的经验,它是明智的重载方法?什么是极限?什么解决方法?

I like to overload methods to support more and more default cases. What is the performance impact of method overloading? From your experience, is it advisable to overload methods? What is the limit? What are the workarounds?

推荐答案

超载对性能没有影响;它是由编译器在编译时解决。

Overloading has no impact on performance; it's resolved by the compiler at compile-time.

作为设计的指导,请参阅设计指南:

As for design guidance, see the design guidelines:

<一个href="http://msdn.microsoft.com/en-us/library/ms229029.aspx">http://msdn.microsoft.com/en-us/library/ms229029.aspx

这篇关于方法重载 - 好的或坏的设计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆