Why and when do we need it?
Let us start with an example before going into the specifics.
Consider that we are building an OTT platform. Each user will have an account where he can save his favorite programs. He should be able to access his account from different platforms like Mobile App or browsers.
Each of the platforms will have its own web interfaces, some lean and some extensive.
For learning’s sake, let us assume that the user model is only going to have the below details:
ProgramInfo is going to have the below details:
A simple explanation with code snippets
Disclaimer: This is an oversimplified explanation. Please ignore minor oversights, thank you.
So, what is Java instrumentation?
You might have read that it is a way to add extra byte code to your application byte code. If you want to add something to your application while it is executed, without actually touching the application code, then instrumentation is what you want to do.
So why exactly is it significant, and who uses it?
Java instrumentation is used mostly by Application Tools like jaCoCO, Profilers, and Monitoring tools like Datadog, Instana, etc. These tools need…
Simple case study with Code snippets
Admit it, there is no turning back once you are deep into Java stream processing.
You cringe at the sight of For loops in your old code. Everything is wonderful with stream processing except one. Wrapper classes.
If your data processing is complex, and if there are multiple data transformation steps involved, you would need to create wrapper classes that take a lot of space.
Even if the wrapper classes are immutable(without setters), you will still need to create an inner class within your service class.
This is one of the places, Record classes…
A simple explanation for Java Engineers with a case study
With new technologies and frameworks coming into the Software Engineering stack every single day, it has indeed become a curse for the Developers to jump and adapt to any new technology that created a buzz. But unless your project demands it, there is absolutely no need for us to adapt to it.
Take a good look at the image above.
What is happening there?
When I started coding, I did not understand why Java code needs a virtual machine (JVM). If you are also confused about it, please read the next three paragraphs. Others can skip it.
Build once, Run anywhere.
This was the mantra for Java. Wherever you write your code, be it Mac or Linux, when you compile it with JDK, it creates a byte-code (your class files). You can package your class files into a jar file and transfer it to any platform to run it.
Simply put, Javax validation works with two main group of annotations
If we are not using the Spring framework in our project, hibernate validator would be the most common implementation for JSR validation specifications.
When a parameter is annotated with @Valid, Java will know that this object needs to be validated, all the constraints declared inside the class will be evaluated.
Let us use a simple model with few constraints like @NotEmpty, @Min defined…
Do you remember how you went to sleep when you were a small Child?
Someone told you a story, didn’t they?
Or you dreamed of a story.
You were a fairy child, and you had sparkles in your hair and you had a magic wand.
Everyone looked at you, and you smiled like a soft faced Angel.
Sometimes, you had white laced Wings, and you floated above the golden yellow fields.
You looked beautiful.
Sometimes, you went to Wonderland with your friends; you got into Ferris wheel and the boy you liked, noticed you.
He talked to you; you had…
Full time software developer. l like to grow plants and write stories.