Singleton Pattern with Thread-safe and Reflection-safe
What is a Singleton Pattern Following constraints are applied: Where we can…
July 02, 2019
It is very easy to build a software or app. But, it is trickier to have a good design that gives you good maintainability over long period of time, and that serves the purpose.
Listing down few design principles that can help greatly in designing applications or softwares:
In simpler terms: Identify the aspects of your application that vary and separate them from what stays the same. It will result in more flexibility in your code. And, this is very powerful concept, as it is being used in many design patterns.
It gives you a lot of flexibility in changing the actual implementation at any time, without the need to change the code. Or, change in smaller portion of the code. Otherwise, you are bound to some implementation, and for every new implementation change, you need a massive code change.
Inheritance is good but in practical, this can become overhead. Many beginner consider it as re-usability. But, Composition provides reusablity. It provides several benefits like: - You can encapsulate the implementation or algorithms - You can change the behavior at runtime - You can have list of that object instead of inheritance
What is a Singleton Pattern Following constraints are applied: Where we can…
In this post, we will see some of the frequently used concepts/vocabulary in…
System design interview is pretty common these days, specially if you are having…
Introduction You are given an array of integers with size N, and a number K…
Graph Topological Sorting This is a well known problem in graph world…
Problem Statement Given a Binary tree, print out nodes in level order traversal…
Problem Statement Given an array nums of n integers and an integer target, are…