I wonder when it is a bad idea to use singletons in Java.
Specifically I am to build an API where files will be submitted to my API (or actually the file name and then the file will be located in a specific directory).
There are no specifications on how many transactions needs to be handled. If there would have been my stomach tells me it would be good to have a singleton taking care adding to of the inqueue and making sure it is not bigger then MAX_ALLOWED_SIZE (a value set to a reasonable figure to make sure the system is stable).
Something I do know is that I need to have a very good idea on how to make the code testable. Something that is abit tricky when it comes to singletons.
-On the system level - performance wise maybe
Please elaborate on when to use a singleton and when not, and also how to handle Junit testing and also if possible a good way to handle performance testing.
I wonder when it is a bad idea to use singletons in Java. It is a bad idea to use singletons when singletons don't fit with your design. And yes, that statement was intentionally vague because your question
Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.
This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…