Android

Part 2 | Understanding Annotations: Basics and Custom Solutions in Java/Kotlin

In Part 1, we discussed the fundamentals of annotations in Java and Kotlin, including an overview of what annotations are, the various types of built-in annotations like @Override, @Deprecated, etc., and how they simplify common programming tasks. We also explored the basic structure of annotations, how to define them, and the importance of using them […]

Mohd Faizan
Mohd Faizan
Read

Android

Understanding Annotations: Basics and Custom Solutions in Java/Kotlin | Part 1

Introduction to Annotations and Their Types Before we dive into the details, let me give you a quick overview of what we’ll cover in this blog. First, we’ll introduce annotations and highlight their importance in modern development. After that, we’ll explore the built-in annotations available in both Java and Kotlin. Once we’ve got the basics […]

Mohd Faizan
Mohd Faizan
Read

Java/JVMTechnology

Working with TestNG Annotations (Part1)

TestNG is a Java Framework to set up the execution flow of the code and for reporting purpose.  Annotations used in TestNG: Annotation Description @BeforeSuite BeforeSuite annotation method runs only once before all tests from the suite. @AfterSuite AfterSuite annotation method runs only once after all tests from the suite. @BeforeClass BeforeClass Method runs only […]

Technology

Use Freedom! and Heartbeat – Be a better YouTuber!

  Starting a YouTube channel is easy but keeping it up and running is somewhat tipsy. You struggle to get enough views and subscribers in the beginning and it doesn’t matter how good your content is, you rank low. This is because you still have to optimize your videos with proper tags and long but […]

Grails

Groovy Annotations for Logging

We use logging in our application to report and persist error and warning messages as well as info messages (e.g. runtime statistics) so that the messages can later be retrieved and analyzed. Initially we were getting an instance of Logger from LoggerFactory and uses it in our class for logging information, errors, exceptions, warnings etc. […]

Technology

@Canonical annotation

@Canonical: It’s very useful annotation. It provides the combination of features of @ToString (default implementation of toString() method based upon the fields in the class), @EqualsAndHashCode(default implementation of equals() and hashCode() method of the class based upon the fields in the class) and @TupleConstructor (provides the classical constructor with default properties). [groovy] import groovy.transform.Canonical @Canonical […]

Mohit Garg
Mohit Garg
Read

Grails

Attributes of Spring Cache

In my previous blog, i have mentioned how to integrate spring cache plugin in grails. In this blog we will see how we can use different attributes of cache. Different attributes of cache :- maxElementsInMemory- How many elements you can store in cache overflowToDisk-The attribute overflowToDisk is true, meaning that whenever the maximum number of […]

Mohit Garg
Mohit Garg
Read

Grails

How to integrate Spring cache plugin with Grails

In one of my recent project, i want to cache  method output. For implementing method level cache, i have used spring cache. For implement Spring cache, we can use grails cache plugin. It’s very easy to integrate cache plugin with grails. 1. Add following plugin dependency in BuildConfig.groovy. [groovy]compile ":springcache:1.3.1" [/groovy] 2.  We need to […]

Mohit Garg
Mohit Garg
Read

Grails

Restricting Access To Plugin’s Classes With Spring Security

Many of Grails plugin like searchable  and console can prove to be really dangerous if access to their URLs is not blocked. After adding searchable plugin to my project, I realized that access to its controllers was not defined and was open for all. Now this was a major security concern. There are many ways […]