java - Static method,new thread performance question -


I have only two questions about the two methods used in many controllers / servlets in my app:

1 What is the difference between calling a steady method in a useful class or non-static method (such as how to deal with dates or for the current time, changing between timezones), which is better? 2-What is the difference between calling a method (there are many arguments like sending an email) in the controller or running this method in a different thread?

1)

  • The classes are generally not used to have any state with them. In fact, there is nothing wrong in creating "example" in them.
  • Although the compiler will never complain, the UL class interfication will be a misleading coding.
  • Stateless Utilis class is completely Are safe, class methods, whether stabilized or not, on every thread stack frame. Get the copy and do not interfere with each other. Java Utilities classes are excellent examples of this.

2)

  • If your method takes a time , It means to make asynchronous calls

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -