Posts

Showing posts with the label SingletonCollection

Observability Done Right: Best Practices and Anti-Patterns for Effective System Monitoring

Image
  WHAT Observability is a concept that refers to the ability to gain insights into the behavior and performance of complex systems. In the context of software engineering, observability involves the collection, analysis, and visualization of data from software applications, infrastructure, and other components of a system. In the animal kingdom, observability plays a critical role in survival, allowing animals to monitor their surroundings, detect threats, and find food. Dolphins use echolocation to observe their surroundings. They emit high-frequency sounds that bounce off objects, allowing them to create a 3D map of their environment. Thanks for reading Knowledge Cafe! Subscribe for free to receive new posts and support my work. Subscribed WHY In today's era, architectures are becoming increasingly large, complex, and fast-paced due to the faster development and deployment of software by distributed teams with the help of DevOps, continuous delivery, and agile development methodo...

Singleton Collection Classes

Image
Singletons are useful to provide a unique source of data or functionality to other Java Objects. Collection framework provides singleton classes for each collection class like SingletonList and SingletonMap.   In this article we will discuss about SingletonList which is equally applicable to other singleton collection classes. Collections Class provide method to convert normal list into singletonList like below syntax, List<String> mySingletonList = Collections. singletonList ( "AAA" ); Java documentation says "Returns an immutable list containing only the specified object. The returned list is serializable." Why we need this type single object Immutable list? Below is the code to remove all null values from list - in conventional style: package singleton; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SingletonListTest { public static void main (String[] args) { List ...