简体   繁体   English

Utility和Helper类之间的区别

[英]Difference between Utility and Helper classes

Aren't utility classes really the same concept as helpers? 实用程序类与辅助程序的概念是否真的相同? I mean utility methods don't extend an existing class such as helpers but the two types of methods really could be referred to as "Helpers" in either case. 我的意思是实用程序方法不扩展现有的类,例如助手,但在任何一种情况下,两种类型的方法实际上都可以称为“助手”。

Utility classes are useful by itself; 实用程序类本身很有用; whereas helper classes are classes with extension methods which will help extend the types. 而辅助类是具有扩展方法的类,有助于扩展类型。

Utility classes tend to be static methods and definitions, where as helper classes could be nodes in a linked list. 实用程序类往往是静态方法和定义,其中辅助类可以是链表中的节点。 That is how I use the terminology. 这就是我使用术语的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM