The SOLID principles were first conceptualized by Robert C. Martin in his 2000 paper, Design Principles and Design Patterns. These concepts were later built upon by Michael Feathers, who introduced us to the SOLID acronym. And in the last 20 years, these 5 principles have revolutionized the world of object-oriented programming, changing the way that we write software.
So, what is SOLID and how does it help us write better code? Simply put, Martin’s and Feathers’ design principles encourage us to create more maintainable, understandable, and flexible software. …
Logs are often known as one of the three pillars of observability. They are great for debugging code running in production. However they can also create a lot of data and noise. You want to have deep insight into your application but at the same time you only care about the information that matters. Thus logging libraries have many logging levels, e.g.
You specify your global logging level and all logs with this level and greater will show up. For example, if you set your global…
Quartz is an open source Java library for scheduling Jobs. It has a very rich set of features including but not limited to persistent Jobs, transactions, and clustering.
You can schedule Jobs to be executed at a certain time of day, or periodically at a certain interval, and much more. Quartz provides a fluent API for creating jobs and scheduling them.
Quartz Jobs can be persisted into a database, or a cache, or in-memory. This is in contrast to Spring’s built-in task scheduling API that doesn’t support persistent jobs.
In this article, you’ll learn how to schedule Jobs in spring…
The ConcurrentModificationException occurs when an object is tried to be modified concurrently when it is not permissible. This exception usually comes when one is working with Java Collection classes.
For Example : It is not permissible for a thread to modify a Collection when some other thread is iterating over it. This is because the result of the iteration becomes undefined with it. Some implementation of the Iterator class throws this exception, including all those general-purpose implementations of Iterator which are provided by the JRE. …
CQRS stands for Command Query Responsibility Segregation. As the name suggests, we split the application into two parts: Command-Side and Query-Side. Now, one will ask, what do “command” and “query” mean?
In traditional data management systems, both commands and queries are executed against the same set of entities, having a single representation, or view. …
To avoid apparent setbacks in Software Development, engineers keep reinventing the wheel time and again. However, the process of developing a bug-free, scalable, high-performing, and enterprise-level web app needs much more than that. For example, a tried and tested outline like the 12 Factor App.
Now, what does the term “Twelve-Factor App” mean in software development, from where does it come, and what are 12-Factor App benefits? Let’s find out.
Que 1 : Why do we use
DAO, and when should we use them ? If you are developing a
GUIJava software to do with inserting, editing, deleting data. But you are struggling to distinguish between
Controller(MVC) Structure? Are they similar, which is better to use when interacting with database through Java
DTO is an abbreviation for Data Transfer Object, so it is used to transfer the data between classes and modules of your application.
DTOshould only contain private fields for your data, getters, setters, and constructors.
Thread is the path of execution in application. Applications can have multiple threads which are executed in parallel. In Java, threads are instances of
java.lang.Thread class or subclasses which extend the Thread class. Every thread has priority (min. 1, max. 10) which is used by Thread Scheduler to determine the priority of execution. Also, a new created thread has an initial priority set from the creating thread (parent thread).
The main thread is a single non-daemon thread that is started by JVM to execute the main method. Default priority of the main thread is 5.
public static void main(String args)…
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
│ └── depl.yaml
App.java is the entry point of the application:
The code above contains the minimal lines needed to create a Spring Boot application.
HelloWorldCtrl.java contains a simple controller that maps the root path
(“/”) and returns a greeting String:
In order to create a K8s deployment, we’ll need a Docker image. Let’s add the following lines to our
The steps in our…
All major server side languages support concurrency (concurrent requests) using multi thread or multi process programming like Java, .Net, Ruby & PHP, etc, until Event driven model becomes popular.
Node JS uses single thread event loop model architecture to support concurrency. All incoming request handled by single thread & shared resources in node js application. In detail, The main event loop is run on single thread with all I/O operation runs on separate threads because of its non-blocking design in order to utilize the event loop.
How it work: