简体   繁体   English

我应该避免在Spring util包中使用类吗?

[英]Should I avoid using classes in Spring util package?

There are many useful utility classes under the org.springframework.util package, however, many of them also has this on their document. org.springframework.util包下有许多有用的实用程序类,但是,它们中的许多都在它们的文档中有这个。

Mainly for internal use within the framework 主要供框架内部使用

Is it safe to use these classes in application ? 在应用程序中使用这些类是否安全?

Yes, it is fine to use them. 是的,可以使用它们。 Those classes provide static helper methods that shouldn't contain any mutable static state. 这些类提供了不应包含任何可变static static助手方法。

If the classes and methods are public, it is safe. 如果类和方法是公开的,那么它是安全的。 Read the documentation carefully to make sure that there will not be any side effects on the rest of the framework. 仔细阅读文档以确保不会对框架的其余部分产生任何副作用。

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

相关问题 在使用java.util.concurrent类时,我应该同步以避免可见性问题吗? - Should I synchronize to avoid visiblity issues when using java.util.concurrent classes? 在进行Spring Web Flow时应该使用@Controller类吗 - Should I be using @Controller classes when doing Spring web flow 我应该如何将这些类分离到包/库中? - How should I separate these classes into the package/library? JMS Queue 是 Java Util Queues 的实现吗? 使用 Java Util Queue 实现的 Java package 中有哪些类? - Is JMS Queue an implementation of Java Util Queues? What are classes in Java package using Java Util Queue implementations? 我应该避免使用注释吗? - Should I avoid using annotations? 我应该使用超级类吗? - Should I be using Super Classes? 当使用黑盒测试可测试类时,我应该避免使用Di吗? - Should I avoid Di when classes are testable with black box testing 什么时候应该创建类以避免巨大的main方法? - When should I create classes in order to avoid huge main method? java.util包 - 类和接口 - java.util package - classes vs interfaces 使用 Spring 时,如何抑制 checkstyle 消息“Utility classes should not have a public of default constructor” - How can I supress the checkstyle message "Utility classes should not have a public of default constructor" when using Spring
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM