<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Janani Subbiah on Medium]]></title>
        <description><![CDATA[Stories by Janani Subbiah on Medium]]></description>
        <link>https://medium.com/@intsandstrings?source=rss-906039a41916------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kXGIh1krUMPElog0RA0wsw.jpeg</url>
            <title>Stories by Janani Subbiah on Medium</title>
            <link>https://medium.com/@intsandstrings?source=rss-906039a41916------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 01:47:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@intsandstrings/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Type driven Deserialization in Kotlin using Jackson]]></title>
            <link>https://medium.com/javarevisited/type-driven-deserialization-in-kotlin-using-jackson-a0b2b5a729a1?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0b2b5a729a1</guid>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[json-deserialization]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 15:06:05 GMT</pubDate>
            <atom:updated>2024-10-02T15:06:05.305Z</atom:updated>
            <content:encoded><![CDATA[<p>Deserializing data into closely related objects based on information in the JSON</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-SZyvF642AsexnYxiO1ElA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alenaganzhela?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Alena Ganzhela</a> on <a href="https://unsplash.com/photos/white-printer-paper-with-green-leaves-L643tFNGUM0?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>In this article we will talk about how to deserialize a section of json data into concrete Kotlin objects based on certain values in the json request. For this example I am using Kotlin with Jackson.</p><p>Let us consider an example where we have a json request come in that could be one of two types: a student or an employee. Both these types will have a name, type (could be student or employee) and some information specific to the person. In case of students the information part will contain the grade and in case of employees it will contain the salary.</p><pre>data class Person(<br> val name: String,<br> val type: PersonType,<br> val info: PersonInfo<br>)<br><br>enum class PersonType : Serializable {<br> // We use the JsonProperty annotation here are <br> // our enums are in uppercase but we want to map <br> // lower case values in the incoming request to the correct enum<br> @JsonProperty(&quot;student&quot;) STUDENT,<br> @JsonProperty(&quot;employee&quot;) EMPLOYEE<br>}<br><br>interface PersonInfo<br><br>data class Student(<br> val grade: Int<br>): PersonInfo<br><br>data class Employee(<br> val salary: Int<br>): PersonInfo</pre><p>Next, we add all the magic annotations (well just two)that will let your code analyze the raw json request body and know if the incoming request needs to be deserialized into a Student class or an Employee class.</p><pre>data class Person(<br> val name: String,<br> val type: PersonType,<br> @JsonTypeInfo(<br>  use = JsonTypeInfo.Id.NAME,<br>  include = JsonTypeInfo.As.EXTERNAL_PROPERTY,<br>  property = &quot;type&quot;,<br>  visible = true<br> )<br> @JsonSubTypes(value = [<br>  JsonSubTypes.Type(value = Student::class, name = &quot;student&quot;),<br>  JsonSubTypes.Type(value = Employee::class, name = &quot;employee&quot;)<br> ])<br> val info: PersonInfo<br>)<br><br>enum class PersonType {<br> @JsonProperty(&quot;student&quot;) STUDENT,<br> @JsonProperty(&quot;employee&quot;) EMPLOYEE<br>}<br><br>interface PersonInfo<br><br>data class Student(<br> val grade: Int<br>): PersonInfo<br><br>data class Employee(<br> val salary: Int<br>): PersonInfo</pre><p>Now if we wanted to test this code, we could wrap this all up in a very simple Spring Boot application (I am using Spring boot version 3.3.4 with JDK version 21) that will just try to read the incoming request body and send that back in a response. So if deserialization fails, we will see an error and not a successful response.</p><pre>@SpringBootApplication<br>class DemoApplication<br><br>fun main(args: Array&lt;String&gt;) {<br>    runApplication&lt;DemoApplication&gt;(*args)<br>}<br><br>@Configuration<br>class RouterConfiguration {<br><br>    @Bean<br>    fun routerconfig() = RouterFunctions<br>       .route(<br>          RequestPredicates.POST(&quot;/person&quot;)<br>       ) { request -&gt;<br>          ServerResponse.ok().body(request.body(Person::class.java))<br>       }<br>}<br><br>data class Person(<br>    val name: String,<br>    val type: PersonType,<br>    @JsonTypeInfo(<br>       use = JsonTypeInfo.Id.NAME,<br>       include = JsonTypeInfo.As.EXTERNAL_PROPERTY,<br>       property = &quot;type&quot;,<br>       visible = true<br>    )<br>    @JsonSubTypes(value = [<br>       JsonSubTypes.Type(value = Student::class, name = &quot;student&quot;),<br>       JsonSubTypes.Type(value = Employee::class, name = &quot;employee&quot;)<br>    ])<br>    val info: PersonInfo<br>)<br><br>enum class PersonType {<br>    @JsonProperty(&quot;student&quot;) STUDENT,<br>    @JsonProperty(&quot;employee&quot;) EMPLOYEE<br>}<br><br>interface PersonInfo<br><br>data class Student(<br>    val grade: Int<br>): PersonInfo<br><br>data class Employee(<br>    val salary: Int<br>): PersonInfo</pre><p>Using Postman to test this we can see that student and employee types get deserialized with no issues!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXGNPt1tqm_8bUU40vBlyQ.png" /><figcaption>Student</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyftGaUuh0wJqAe4QHDWQg.png" /><figcaption>Employee</figcaption></figure><p>And there we have it! The ability to deserialize into concrete data classes based on the value of a field in the request body.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0b2b5a729a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/type-driven-deserialization-in-kotlin-using-jackson-a0b2b5a729a1">Type driven Deserialization in Kotlin using Jackson</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Beans: Do’s, Don’ts and Nice-To-Do’s]]></title>
            <link>https://medium.com/javarevisited/creating-beans-dos-don-ts-and-nice-to-do-s-5327b2047f75?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/5327b2047f75</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 15:29:01 GMT</pubDate>
            <atom:updated>2024-08-06T15:29:01.215Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdnSqsXCxTA5bZ54-qGNHg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@pariwatt?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">pariwat pannium</a> on <a href="https://unsplash.com/photos/white-ceramic-mug-on-brown-wooden-table-S8daAB_nJSg?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>Dependency injection is one of the best things that exists if used correctly. Once messed up, it can be a nightmare. Spring/Spring Boot provides a lot of support for dependency injection: easy to drop annotations, multiple annotations that will create dependencies (aka beans) that will get injected into classes that need them without developers having to worry about how or where they get created.</p><p>Before slapping one of those easy-to-use-annotations it is important to ask this question: Does this need to be a bean? Let me break this down further:</p><ul><li>Does this need to be a bean?</li><li>What classes need functionality from this bean?</li><li>Is this bean required by more than one class?</li><li>Is a bean of this type already available from the framework?</li></ul><p>Answering these questions will help decide how to create the bean, if one needs to be created. Let us look at some scenarios and understand if a bean is required (and how to create one if needed):</p><h4>Create a bean only if required by multiple classes (mostly)</h4><p>If there is a component that only a single class uses, that component might not need to be a bean at all. A new instance of that component can be created right inside the class that needs it or at the time of creating that class. The reason: Why expose something as a bean when it doesn’t need to be one.</p><pre>class GoogleGeocodingClient {<br><br>    fun getAddress(lat: Float, long: Float): String {<br>        // Code to talk to Google&#39;s Maps service to get the <br>        // address corresponsing to a lat long coordinate value<br>    }<br><br>}<br><br>@Service<br>class UserService {<br><br>    private val googleGeocodingClient: GoogleGeocodingClient = GoogleGeocodingClient()<br><br>    fun getCurrentAddress() {<br>        // Code that uses googleGeocodingClient<br>    }<br><br>}</pre><p>In the above example if an instance of the `GoogleGeocodingClient` is only required by one other class, then we can start with not making it a bean (this can change if more classes need to use `GoogleGeocodingClient`) and allowing the class that needs `GoogleGeocodingClient` to create a private instance.</p><h4>Reusing framework provided beans</h4><p>Check to see if a bean of the type you are trying to create is already provided by Spring. If so see if you can reuse it. The reason I recommend this (unless you see a very good reason not to go this route) is this will give you a lot of good default choices automatically. If you re-create that bean for use by your application chances are you are overlooking certain default settings/configurations for that bean in question that might be battle tested by the framework.</p><h4>Using a central configuration for all bean/object creation</h4><p>We can take the above example a step further and create a configuration class that creates a bean of type UserService . Personally I prefer config classes because they centralize bean creation and that way I don’t have to sift thro all classes to see which ones carry one of the many annotations that turn them into beans (like @Component, @Service etc). So the above code could be re-written as:</p><pre>class GoogleGeocodingClient {<br><br>    fun getAddress(lat: Float, long: Float): String {<br>        // Code to talk to Google&#39;s Maps service to get the <br>        // address corresponsing to a lat long coordinate value<br>    }<br><br>}<br><br><br>class UserService(googleGeocodingClient: GoogleGeocodingClient) {<br><br>    fun getCurrentAddress() {<br>        // Code that uses googleGeocodingClient<br>    }<br><br>}<br><br>@Configuration<br>class UserServiceConfiguration {<br><br>    private val googleGeocodingClient: GoogleGeocodingClient = GoogleGeocodingClient()<br><br>    @Bean<br>    fun userService() = UserService(googleGeocodingClient)<br>}</pre><p>If in the future there comes a need to inject an instance of the GoogleGeocodingClient into another class you can just reuse the instance created in the UserServiceConfiguration and create a bean of the other class that needs it right here.</p><p>A caveat to address while creating configuration classes is to make sure they don’t get too big. If they do, breaking them up is always a good and maintanable option!</p><h4>Conditional bean creation</h4><p>In a lot of cases beans of certain types are required only under specific conditions. For example creating a bean could be based on properties or on having certain dependencies present on the class path or the condition itself can be custom (Spring provides easy to use annotations to achieve this). These conditional annotations can be used on configuration classes or on classes that carry one of Spring’s annotations that indicate to the framework that a bean of that class needs to be created.</p><p>The advantage of the previous step where we combine bean creation into a central configuration is that it can be taken a step further and we can now create a configuration class where all the beans created inside that class are driven by a single condition that is carried by the configuration class itself. So the above code would be re-written as follows (to make this more meaningful I am going to make an assumption that my application might need to use different types of user services depending on application properties):</p><pre>class GoogleGeocodingClient {<br><br>    fun getAddress(lat: Float, long: Float): String {<br>        // Code to talk to Google&#39;s Maps service to get the <br>        // address corresponsing to a lat long coordinate value<br>    }<br><br>}<br><br>interface UserService {<br><br>    fun getCurrentAddress() {<br>        // ...<br>    }<br>}<br><br>class GoogleUserService(geocodingClient: GoogleGeocodingClient): UserService {<br><br>    override fun getCurrentAddress() {<br>        // Code that uses geocodingClient<br>    }<br><br>}<br><br>class AppleUserService(geocodingClient: GoogleGeocodingClient): UserService {<br><br>    override fun getCurrentAddress() {<br>        // Code that uses geocodingClient<br>    }<br><br>}<br><br>@Configuration<br>// The app will look for the value of &quot;user.service&quot; to decide which configuration to run<br>@ConditionalOnProperty(prefix = &quot;user&quot;, name = [&quot;service&quot;], havingValue = &quot;Google&quot;)<br>class GoogleUserServiceConfiguration {<br><br>    private val googleGeocodingClient: GoogleGeocodingClient = GoogleGeocodingClient()<br><br>    @Bean<br>    fun userService() = GoogleUserService(googleGeocodingClient)<br>}<br><br>@Configuration<br>@ConditionalOnProperty(prefix = &quot;user&quot;, name = [&quot;service&quot;], havingValue = &quot;Apple&quot;)<br>class AppleUserServiceConfiguration {<br><br>    private val googleGeocodingClient: GoogleGeocodingClient = GoogleGeocodingClient()<br><br>    @Bean<br>    fun userService() = AppleUserService(googleGeocodingClient)<br>}</pre><p>This truly shines when you want your application to be vendor/API provider agnostic. You define an interface based on the functionality required and specific implementation classes are created that will satisfy the contract provided by the interface. You can then use custom properties in your application to indicate which specific implementation of the interface is to be used!</p><p>Please note that conditional annotations can be used alongside annotations that automagically create beans (like @Component etc)</p><h4>TL;DR</h4><ul><li>Create beans of classes that are (or could be needed) by more than one class. Not all dependencies need to be beans.</li><li>Configuration classes can be helpful in centralizing all similar beans and objects creation.</li><li>Conditionals on Configuration classes are very helpfu! Use them wisely.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5327b2047f75" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/creating-beans-dos-don-ts-and-nice-to-do-s-5327b2047f75">Creating Beans: Do’s, Don’ts and Nice-To-Do’s</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Permission Bitmasks: An Introduction]]></title>
            <link>https://blog.devgenius.io/permission-bitmasks-an-introduction-ef87d4e3100?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef87d4e3100</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[bitmask]]></category>
            <category><![CDATA[roles-and-permissions]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-security]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 13:22:14 GMT</pubDate>
            <atom:updated>2023-06-01T13:22:14.581Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFWBNtJP7lu5IXXMo4erzw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/pt-br/@isaacquesada?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Isaac Quesada</a> on <a href="https://unsplash.com/photos/cbOa0qgAit4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Roles and permissions for the purposes of Role Based Access Control (RBAC) is a very common requirement/feature for a lot of applications. As a part of this blog post I want to provide a very simple introduction to one specific implementation of roles and permissions in a datastore.</p><p>The whole idea of permission bitmasks is to map bit positions to permissions. We start by identifying resources in our system followed by defining what actions we want to allow on those resources.</p><h4>Step 1: Resource Identification</h4><p>To simplify this let us consider a library management system that manages information on a bunch of books. So our resource here would be books.</p><h4>Step 2: Operations on Resource</h4><p>Next we can define actions/operations we want to allow on books: Create, Read, Update and Delete.</p><h4>Step 3: Next we define bit positions for our identified operations.</h4><p>Create: Bit 0<br>Read: Bit 1<br>Update: Bit 2<br>Delete: Bit 3</p><p>Each of these bits can have one of two values: 0 or 1. A zero in a bit position would mean that the user does not have the permission to perform the operation that is denoted by that bit position. For example, if User A has a value of 0 in bit position 2, we can conclude that User A cannot update books. This might seem a confusing right now, but the hope is following sections can clarify any questions you may have right now!</p><h4>Step 4: Assign Permission Decimals</h4><p>This step is probably one of the most crucial that actually brings the whole concept home.</p><p>For every user in the system we assign permissions i.e. we assign 0s or 1s in all the bit positions we have identified above and compute the decimal value for the same.</p><p>For example, User A can create and read books information but cannot update or delete them. So we start of by assigning 0s and 1s to bit positions:</p><p>Bit 0: 1<br>Bit 1: 1<br>Bit 2: 0<br>Bit 3: 0</p><p>So the binary value of their permission would be: 0011. If we were to convert this to a decimal value we get 2. So the value “2” will be assigned as User A’s permission within the library management system.</p><p>This way every user in the System will get a decimal value that will denote what books operations they are authorized to do.</p><h4>Step 5: Authorization Rules using Permission Bitmasks</h4><p>The final step is to enforce the rules defined above! Say we have APIs to create, read, update and delete books. On each of these APIs we will have authorization rules that will make sure the bit position the operation corresponds to is 1 and not 0. For example, when User A accesses the read books API, the authorization rule check will be to make sure the permission value for User A (which we computed to be 2 in the previous step), has a value of 1 in the 1st bit position. So 2 will be converted to its corresponding binary value (0011) and bit position 1 is checked. If the value is 1 then the request is allowed to be processed further. If it is 0, then a 403 (forbidden) is returned.</p><h4>Step 6: Extending Permission Bitmasks to Other Resource</h4><p>In our example we only talked about a single resource: books. But we can extend this whole concept to many more resources. A unique bit position will need to be assigned to every resource and operation combination!</p><h4>Step 7: Introducing Roles</h4><p>In order to make managing permissions easier, we can introduce a concept of roles. For all intents and purposes, roles are nothing but a collection of permissions.</p><p>Instead of assigning permission decimal values to users directly, we can introduce a layer of abstraction: Roles, that instead will contain the permission decimal value and users will be assigned those roles instead. This abstraction truly shines when you have to update permissions for a set of users. Without roles, every user in the system may need to have their permission decimal value recomputed and reassigned. With roles, because there is no direct mapping between permission values and users, we might just have to recompute and reassign the value of one of more roles and all users with those roles have now been updated!</p><p>For example, let us introduce “Customer” and “Staff” as two possible roles in the library management system. Customers can only read books information while Staff can create, read, update and delete books information. So we introduce roles with their corresponding permission decimal value:</p><p>Customer =&gt; 0001 =&gt; 1<br>Staff =&gt; 1111 =&gt; 15</p><p>We then assign these roles to all users in our system.</p><p>If we were to make updates to the system to not allow staffs to delete books, we would recompute and reassign the value of the Staff role and all the users with that role will not get the new values automatically:</p><p>Staff =&gt; 0111 =&gt; 7</p><p>Without roles, we would have had to assign the new value (7) to all staff users in our system.</p><p>Permission bitmasks are a very efficient way to implement permissions and roles. IMO they truly shine when there are data storage shortages. If you are concerned about the amount of storage space taken up by your data, permission bitmasks can be great way to cut back on space! Permission bitmasks also provide an excellent abstraction if you do not want to expose your permission model in direct human readable form. Unless someone know what bit is assigned to what position, it is almost useless to know that User A has a permission value of 4.</p><p>But there is a catch: A learning curve. Depending on the team looking to implement and manage permissions, bitmasks can pose a considerable learning curve. They can also get complicated over time especially if there are many roles, resources and operations to manage. Finally reusing a bit position for a different permission could lead to more headache based on how complex the permission model is. For example, if we decide we want to delete the API to delete books, the permission value assigned to bit 3 becomes pointless. We have three options here:</p><ul><li>Leave that bit as is and make sure no part of the code uses it.</li><li>Set that bit value to 0 which in this case would mean no user can delete a book. Followed by the necessary re-computations and re-assignments of roles values.</li><li>Move the permission bits by one. So all the bits that come after bit 3 will get shifted by one position to the right. For example, if bit 4 was assigned to operation X on resource 3, with the new assignment, bit 3 will be assigned to operation X on resource 3. This way all bit positions are assigned to permissions needed and used by the application. The biggest and most obvious downside is re-computation of all role permission values could get tedious depending on the complexity of the permission model.</li></ul><p>All the above solutions have a downside. None of them are an A-ok solution and one might have to pick and choose what works best for their application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef87d4e3100" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/permission-bitmasks-an-introduction-ef87d4e3100">Permission Bitmasks: An Introduction</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[For Loops: Java vs Kotlin]]></title>
            <link>https://medium.com/javarevisited/for-loops-java-vs-kotlin-10fe7f9d2990?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/10fe7f9d2990</guid>
            <category><![CDATA[jvm-languages]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[for-loop]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Tue, 22 Nov 2022 14:54:56 GMT</pubDate>
            <atom:updated>2022-11-22T14:54:56.436Z</atom:updated>
            <content:encoded><![CDATA[<p>A very quick for-loop variations in Java and Kotlin!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qLwIFInbJWAQOoEJ-eQBg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@daviidstreit?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">David Streit</a> on <a href="https://unsplash.com/s/photos/loops?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Loops are one of the most basic building block of any programming language. Irrespective of your language of choice, for loops or a variant of it is sure to exist. In that spirit, today I would like to do a side by side comparison of what for loops look like in two very popular JVM languages: Java and Kotlin.</p><h4>Accessing elements directly</h4><p>As an example let us consider a list of numbers that we need to iterate over and print.</p><p>In Java:</p><pre>List&lt;Integer&gt; numbers = new ArrayList(){{<br>  add(3);<br>  add(6); <br>  add(9); <br>  add(12);<br>}};</pre><pre>for(Integer number: numbers) {<br>  System.out.println(number);<br>}</pre><p>The Kotlin version of the code would be (dropping the type decleration as a part of the for loop):</p><pre>val numbers = listOf(3, 6, 9, 12)</pre><pre>for(number in numbers) {<br>  println(number)<br>}</pre><p>Output:</p><pre>3<br>6<br>9<br>12</pre><h4>Accessing elements using the index</h4><p>Having to access elements in a collection like an array or a list is probably programming 101.</p><p>In good old Java that would be:</p><pre>List&lt;Integer&gt; numbers = new ArrayList(){{<br>    add(3);<br>    add(6);<br>    add(9);<br>    add(12);<br>}};</pre><pre>for(int index=0; index&lt;numbers.size(); index++) {<br>    System.<em>out</em>.println(numbers.get(index));<br>}</pre><p>Kotlin has support for ranges that we could for the index (note that both the bounds of the for loop are inclusive):</p><pre>val numbers = listOf(3, 6, 9, 12)</pre><pre>for(index in 0..numbers.size-1) {<br>  println(numbers[index])<br>}</pre><p>Output:</p><pre>3<br>6<br>9<br>12</pre><h4>Accessing elements using the index in reverse</h4><p>If we wanted to access element of the list in reverse order, we would do the following in Java:</p><pre>List&lt;Integer&gt; numbers = new ArrayList(){{<br>    add(3);<br>    add(6);<br>    add(9);<br>    add(12);<br>}};</pre><pre>for(int index=numbers.size()-1; index&gt;=0; index--) {<br>    System.<em>out</em>.println(numbers.get(index));<br>}</pre><p>In Kotlin:</p><pre>val numbers = listOf(3, 6, 9, 12)</pre><pre>for(index in numbers.size-1 downTo 0) {<br>  println(numbers[index])<br>}</pre><p>Output:</p><pre>12<br>9<br>6<br>3</pre><h4>Accessing elements using the index with custom increment</h4><p>And finally if we are looking for a non-1 increment or decrement (using increments of 2 as an example here):</p><p>Java version:</p><pre>List&lt;Integer&gt; numbers = new ArrayList(){{<br>  add(3);<br>  add(6); <br>  add(9); <br>  add(12);<br>}};</pre><pre>for(int index=0; index&lt;numbers.size(); index=index+2) {<br>  System.out.println(numbers.get(index));<br>}</pre><p>Kotlin version:</p><pre>val numbers = listOf(3, 6, 9, 12)</pre><pre>for(index in 0..numbers.size-1 step 2) {<br>  println(numbers[index])<br>}</pre><p>Output:</p><pre>3<br>9</pre><p>And that is a wrap! I hope this helps with being able to fluently switch between writing for loops in Java and Kotlin!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10fe7f9d2990" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/for-loops-java-vs-kotlin-10fe7f9d2990">For Loops: Java vs Kotlin</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecture of a Reactive Spring Boot Application]]></title>
            <link>https://medium.com/javarevisited/architecture-of-a-reactive-spring-boot-application-197bbfe3af78?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/197bbfe3af78</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[webflux]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Thu, 20 Oct 2022 03:18:17 GMT</pubDate>
            <atom:updated>2022-11-22T15:03:00.838Z</atom:updated>
            <content:encoded><![CDATA[<p>Components in a typical spring boot reactive application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbDKIZ8e_GM2g1ZVkv2qiA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jsnbrsc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jason Briscoe</a> on <a href="https://unsplash.com/s/photos/architecture-modern?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Spring boot supports building reactive applications using project reactor under the hood and this means a slight shift in the architecture of reactive spring boot applications as compared to a traditional non-reactive Spring Boot application. In this post I would like to touch on the different components of a reactive Spring Boot application, the terminologies and different options at every layer.</p><h3>Router Function</h3><p>The router function defines the entry point into the application. It defines the routes (aka APIs) exposed by the application which in turn serve as individual entry points. In addition to the API (which consists of the path and the HTTP verb), it also specifies handling of the request i.e. what happens when a request matching a certain API is received. More often than not the handling of an API request is done by the next component in the chain, a Handler.</p><h3>Handler</h3><p>Handler methods process ServerRequest objects and returns a ServerResponse object (in case of a reactive application a Handler method will return a Mono&lt;ServerResponse&gt;). The Handler does not need to perform all steps to convert an incoming ServerRequest to Mono&lt;ServerResponse&gt; but it is the component that uses other components and services for that processing.</p><h3>Other components</h3><p>Below the Handlers are all other components in the application i.e. other beans in the application that can be reused across the app. The components in this layer usually use each other interchangebly. Most of the All other components, more often than not fall under one of the following categories:</p><h4>Service</h4><p>If the processing of an API request requires talking to multiple components and is reusable across the codebase, I like to create a service class that becomes a single place in the code where all these multiple components can be combined and used to generate an output. Service classes help in testing certain processing steps in isolation and help with code reuse and maintanence. Service classes may use other classes in this section including clients, computational units, other services, repositories and computation classes.</p><h4><em>Client</em></h4><p>When a component is responsible for making API calls to other services/ 3rd party APIs, I like to call such classes clients (because they are clients of those services they make API calls to). In case of reactive Spring, chances are you will be using Spring’s WebClient to make API calls. There is no need per se to create a component dedicated to communicating with other APIs. I like to break them up this way because:</p><ul><li>It becomes easy to test this component thoroughly for error as well happy path scenarios.</li><li>All error handling for a specific API can occur in this component in an isolated way.</li><li>Any future changes that might be made to third party APIs, will only mean that the client that interacts with that API will be the only component that will need to be changed.</li></ul><p>It helps to have a client class for every 3rd party API the application interacts with and if modeled that way, a client class may use utility classes, computational classes and repositories (rarely other service/client classes)</p><h4><em>Utility/Helper classes</em></h4><p>No matter what application you are building, chances are you are going to have at least one component that takes care of all validations (as an example). Sometimes, there could be multiple validators to validate different data sets processed by the application. While validators are one kind of utility classes, there are other types that fall into this category (this is not an exclusive list):</p><ul><li>Transformers (E.g.: DTOs/SVOs — &gt; Entities and vice versa)</li><li>Formatters (E.g.: run on data before it is sent to a presentation layer)</li><li>Error handlers</li></ul><p>If utility classes could be broken up the piece of data that needs validation (and this can be done in most cases), a utility class may not need to depend on any other class in the application (except other utility classes).</p><h4>Repository</h4><p>Repositories are spring interfaces/classes that define the contract (and sometimes implementation) for interacting with a datastore (could be relational DB, document store etc). These are not the same as any of the components previously described because spring-data-jpa provides an option to define functions/methods in interfaces marked as repositories and the implementation of those methods is taken care of by Spring (aka <a href="https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.details">query methods</a>). The simplest option to define a repository component is to extend from spring-data’s CrudRepository.</p><p>Repository classes are like clients where there is usually a one on one mapping to an entity (or table in the DB). Repositories <em>usually</em> do not depend on any other spring components.</p><p>The components mentioned this in blog post are just to provide an overall example and do not cover all possible scenarios. Spring Boot’s reactive stack is different from the non-reactive stack not just in terms of operators available to handle requests but also in terms of how requests are handled and processed. I hope this article provides a good starting place for your reactive application backed by Spring Boot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=197bbfe3af78" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/architecture-of-a-reactive-spring-boot-application-197bbfe3af78">Architecture of a Reactive Spring Boot Application</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mentorship Mantras: Mentor Version]]></title>
            <link>https://blog.devgenius.io/mentorship-mantras-mentor-version-84a4aae86979?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/84a4aae86979</guid>
            <category><![CDATA[mentorship-software]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mentorship]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[soft-skills]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Fri, 13 Aug 2021 07:32:58 GMT</pubDate>
            <atom:updated>2021-08-13T07:32:58.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFOcTRCmJs8_k-1WLiynmA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@diegojimenez?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Diego Jimenez</a> on <a href="https://unsplash.com/s/photos/roads?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I remember the first time I mentored about six years ago. I was very excited to finally be on the other side. And overall it went well. I had a wonderful mentee and I thoroughly enjoyed watching them learn and grow over the course of our mentorship. A few years and mentorships later, I think I have enough learnings to put into a blog post! All the lessons learnt the first time have stood the test of time and helped me be more successful at mentorships!</p><p>As with everything else I like to ramble about, I have a list for this one as well, where I would like to talk about mentorship lessons that I have learnt from the few times I have been a mentor:</p><h4>Understanding Goals</h4><p>As a first step I like to find out what my mentee is trying to get out of our mentorship. It could be a deep dive into a certain technology/topic, it could be a help-me-scratch-the-surface-of-this-technology or it could be to build an app/solution. No matter what, understanding what the other person is trying to get out of the mentorship is an absolute must. I usually like this to be a task for the mentee, but it could also be something that we do together (sometimes it helps to talk things through to know what you want). Once you have your goals, next it helps to come up with milestones.</p><h4>Setting Milestones</h4><p>I think setting milestones is a nice to have because this isn’t always possible and this could be hard when you are looking at long term mentorships. But if this applies, then I think it really helps to keep track of progress. Depending on your mentee’s schedule and work load this could be time based of it could be based on specific mentorship milestones (for example, the first milestone could be being able to design a DB schema, the second could be being able to design APIs etc). Making and tracking milestones can give you a good insight into how far along your mentee has come in the mentorship.</p><h4>Time commitments</h4><p>Mentorships need some time commitment. No doubt. But it can be flexible. It is very important to understand how much bandwidth each of you have so that expectations are set straight early on.</p><h4>Understanding learning patterns</h4><p>Another nice to have IMO because this can help ensure learning happens efficiently. Figuring out how to best use the mentorship effectively. Does your mentee prefer to talk through concepts and work on their own later? Or do they prefer to pair with you during your mentorship meetings. Talking through if there is a preference is helpful for both parties. If there are none or your mentee does not have a strong preference, it might be a good idea to try a couple of things to see what works best.</p><h4>Taking a Step Back</h4><p>This is so damn hard. To see someone struggling with something and just letting them struggle for a little longer because you know they are eventually going to get it and you want them to enjoy that absolute precious feeling. The first time I was a mentor, I failed at doing this. Every time my mentee had questions, I would tell them what to do because I felt like I was letting them waste time by not sharing what I knew already. I missed the big part about figuring out answers and how wonderful of a journey (and learning experience) that can be.</p><h4>Guide, Don’t Solve</h4><p>You don’t want to give out answers, but as a mentor you should absolutely guide! If you see that your mentee is going down the wrong path or is trying to solve too many things with a single solution, help them take a step back, help them find a solution by simplifying things. Just don’t take them to the solution directly but don’t let them run blind. Remember they can do that without you.</p><h4>Share Resources</h4><p>This is one of my favorite things to do! After every mentorship session, I usually like to share resources on topics we just had discussions about. This helps with brushing up what we talked about and helps the mentee read about them at their own leisure.</p><h4>Feedback</h4><p>Like with most other things giving and receiving feedback is an absolute must. This cuts both ways. Make sure to provide feedback on progress. If you have specific goals set, feedback conversations are easy because they can revolve around progress towards those goals. Similarly be sure to ask for feedback. It is necessary for you as the mentor to provide the support your mentee is looking for. This can be anywhere in the scale of very involved to I-just-want-you-to-be-there-when-I-need-help. Make sure your mentee is getting what they are looking for from the mentorship. Also make it a point to find out if there is anything they would like to change!</p><p>Mentorships are a great way to give back. Personally for me, wonderful mentors have been instrumental in providing me with a launchpad in my career. As a mentor I have found immense satisfaction in paying it forward. Personal growth has been an added bonus, no doubt.</p><p>Mentors have the power to make or break careers. Having very supportive, brilliant and empathetic mentors has immensely helped my professional growth and any chance to repay that debt by paying it forward is fulfilling!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lM5z0uQiwRLuTRja7KNDWw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@studio_cj?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Christine</a> on <a href="https://unsplash.com/s/photos/growth?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84a4aae86979" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/mentorship-mantras-mentor-version-84a4aae86979">Mentorship Mantras: Mentor Version</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Data Projections]]></title>
            <link>https://medium.com/javarevisited/spring-data-projections-6f4e56023795?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f4e56023795</guid>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[spring-data]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 10:36:06 GMT</pubDate>
            <atom:updated>2021-06-22T10:36:06.034Z</atom:updated>
            <content:encoded><![CDATA[<p>A quick introduction to Spring data Projections!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3t6WOu5JxwRMuEWprQ3Zg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@sadswim?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">ian dooley</a> on <a href="https://unsplash.com/s/photos/neat?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Spring Data supports custom queries in Repositories where developers just need to follow a set way of writing repository methods for the functionality they are looking for. Just defining the method in the interface does the job, for most types of searches at least. Developers pick the functionality and the fields to search by, create the method and pass in the required parameters and the method does what it is supposed to do.</p><p>This is pretty straightforward and easy. But say you don’t (for whatever reason) want the whole entity or object returned as a part of your query. Say you only want a subset of fields from the original entity: Spring data projections to the rescue!</p><p>Spring supports different types of projections: interface-based, class-based, and dynamic projections. For the sake of this article, I am going to stick to interface-based projections. The Spring Data documentation has excellent information on the <a href="https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#projections.dtos">other types</a>!</p><p>Before we jump in, I am using the following versions of tools and languages:</p><ul><li><a href="https://medium.com/javarevisited/top-5-courses-to-learn-kotlin-in-2020-dfc3fa7706d8?source=---------16------------------">Kotlin</a>: 1.4.21</li><li><a href="https://medium.com/javarevisited/5-best-gradle-courses-and-books-to-learn-in-2021-93f49ce8ff8e">Gradle</a>: 6.7.1</li><li><a href="https://medium.com/javarevisited/top-10-courses-to-learn-spring-boot-in-2020-best-of-lot-6ffce88a1b6e?source=---------39------------------">Spring Boot</a>: 2.4.1</li><li>JDK: 15</li></ul><p>On that note, let us talk about how to use spring data projections step by step, using books as the resource we want to manage:</p><h4>Step 1: Defining the Entity</h4><pre>import javax.persistence.Entity<br>import javax.persistence.GeneratedValue<br>import javax.persistence.Id<br><br>@Entity<br>class BookEntity(<br>    val name: String,<br>    val author: String,<br>    val isSeries: Boolean,<br>    val yearPublished: Int,<br>    val publisherName: String,<br>    val genre: String<br>) {<br><br>    @Id<br>    @GeneratedValue<br>    var id: Long = 0<br><br>    override fun equals(other: Any?): Boolean {<br>        if (this === other) return true<br>        if (<em>javaClass </em>!= other?.<em>javaClass</em>) return false<br><br>        other as BookEntity<br><br>        if (name != other.name) return false<br>        if (author != other.author) return false<br>        if (isSeries != other.isSeries) return false<br>        if (yearPublished != other.yearPublished) return false<br>        if (publisherName != other.publisherName) return false<br>        if (genre != other.genre) return false<br><br>        return true<br>    }<br><br>    override fun hashCode(): Int {<br>        var result = name?.hashCode() ?: 0<br>        result = 31 * result + (author?.hashCode() ?: 0)<br>        result = 31 * result + isSeries.hashCode()<br>        result = 31 * result + (yearPublished ?: 0)<br>        result = 31 * result + (publisherName?.hashCode() ?: 0)<br>        result = 31 * result + (genre?.hashCode() ?: 0)<br>        return result<br>    }<br><br>    override fun toString(): String {<br>        return &quot;BookEntity(&quot; +<br>                &quot;name=&#39;$name&#39;, &quot; +<br>                &quot;author=&#39;$author&#39;, &quot; +<br>                &quot;isSeries=$isSeries, &quot; +<br>                &quot;yearPublished=$yearPublished, &quot; +<br>                &quot;publisherName=&#39;$publisherName&#39;, &quot; +<br>                &quot;genre=&#39;$genre&#39;, &quot; +<br>                &quot;id=$id&quot; +<br>                &quot;)&quot;<br>    }<br>}</pre><p>We define a very simple class to manage books. We let the ID field be auto-generated (so that the user does not have to set a value for it) and all other fields are required!</p><h4>Step 2: Defining the Repository</h4><pre>import org.springframework.data.repository.CrudRepository<br><br>interface BookRepository : CrudRepository&lt;BookEntity, Long&gt; {<br><br>    fun findByAuthor(author: String): List&lt;BookEntity&gt;<br>}</pre><p>Next, we define a simple repository to manage books. For the sake of simplicity, we assume we don’t want any pagination or sorting capabilities. So we just extend from <a href="https://www.java67.com/2021/01/spring-data-jpa-interview-questions-answers-java.html">Spring Data’s</a> CrudRepository.</p><h4>Step 3: Using the Repository to Save and Retrieve data</h4><pre>import org.springframework.beans.factory.annotation.Autowired<br>import org.springframework.boot.CommandLineRunner<br>import org.springframework.boot.autoconfigure.SpringBootApplication<br>import org.springframework.boot.runApplication<br><br>@SpringBootApplication<br>class Application : CommandLineRunner {<br><br>   @Autowired<br>   private lateinit var bookRepository: BookRepository<br><br>   override fun run(vararg args: String?) {<br>      bookRepository.saveAll(<br>         <em>listOf</em>(<br>            BookEntity(<br>               name = &quot;Harry Potter and the Chamber of Secrets&quot;,<br>               author = &quot;J K Rowling&quot;,<br>               isSeries = true,<br>               yearPublished = 1998,<br>               publisherName = &quot;Bloomsbury Publishing&quot;,<br>               genre = &quot;Fantasy&quot;<br>            ),<br>            BookEntity(<br>               name = &quot;Harry Potter and the Goblet of Fire&quot;,<br>               author = &quot;J K Rowling&quot;,<br>               isSeries = true,<br>               yearPublished = 2000,<br>               publisherName = &quot;Bloomsbury Publishing&quot;,<br>               genre = &quot;Fantasy&quot;<br>            ),<br>            BookEntity(<br>               name = &quot;Harry Potter and the Deathly Hallows&quot;,<br>               author = &quot;J K Rowling&quot;,<br>               isSeries = true,<br>               yearPublished = 2007,<br>               publisherName = &quot;Bloomsbury Publishing&quot;,<br>               genre = &quot;Fantasy&quot;<br>            ),<br>            BookEntity(<br>               name = &quot;Lord of the Rings: The Fellowship of the Ring&quot;,<br>               author = &quot;J.R.R. Tolkien&quot;,<br>               isSeries = true,<br>               yearPublished = 1954,<br>               publisherName = &quot;Allen &amp; Unwin&quot;,<br>               genre = &quot;Adventure&quot;<br>            ),<br>            BookEntity(<br>               name = &quot;The Lion, the Witch, and the Wardrobe&quot;,<br>               author = &quot;C. S. Lewis&quot;,<br>               isSeries = true,<br>               yearPublished = 1950,<br>               publisherName = &quot;Geoffrey Bles&quot;,<br>               genre = &quot;Children&#39;s Fantasy&quot;<br>            ),<br>            BookEntity(<br>               name = &quot;Gone Girl&quot;,<br>               author = &quot;Gillian Flynnp&quot;,<br>               isSeries = false,<br>               yearPublished = 2012,<br>               publisherName = &quot;Crown Publishing Group&quot;,<br>               genre = &quot;Thriller&quot;<br>            )<br>         )<br>      )<br><br>      bookRepository.findByAuthor(&quot;J K Rowling&quot;)<br>         .<em>forEach </em><strong>{ </strong>book <strong>-&gt; </strong><em>println</em>(book) <strong>}<br>   </strong>}<br>}<br><br>fun main(args: Array&lt;String&gt;) {<br>   <em>runApplication</em>&lt;Application&gt;(*args)<br>}</pre><p>Our DB currently has no data. So we first load it up with some data. We add some <a href="https://medium.com/hackernoon/top-5-spring-boot-and-spring-cloud-books-for-java-developers-75df155dcedc?source=---------23------------------">books </a>and then we fetch them all by the author using the custom query that we created in our Repository.</p><p>If we were to run this app at this point we would see the following in the logs:</p><pre>BookEntity(name=&#39;Harry Potter and the Chamber of Secrets&#39;, author=&#39;J K Rowling&#39;, isSeries=true, yearPublished=1998, publisherName=&#39;Bloomsbury Publishing&#39;, genre=&#39;Fantasy&#39;, id=1)</pre><pre>BookEntity(name=&#39;Harry Potter and the Goblet of Fire&#39;, author=&#39;J K Rowling&#39;, isSeries=true, yearPublished=2000, publisherName=&#39;Bloomsbury Publishing&#39;, genre=&#39;Fantasy&#39;, id=2)</pre><pre>BookEntity(name=&#39;Harry Potter and the Deathly Hallows&#39;, author=&#39;J K Rowling&#39;, isSeries=true, yearPublished=2007, publisherName=&#39;Bloomsbury Publishing&#39;, genre=&#39;Fantasy&#39;, id=3)<br></pre><h4>Step 4: Introducing Projections!</h4><p>Say we only want to get the book names that were written by a certain author vs getting all the information about books. So we create an interface with a single method that starts with get followed by the name of the field we are looking to retrieve (which in our case is name).</p><pre>import org.springframework.beans.factory.annotation.Value<br><br>interface BookName {<br><br>    fun getName(): String<br>}</pre><h4>Step 5: Updating the Repository</h4><pre>import org.springframework.data.repository.CrudRepository<br><br>interface BookRepository : CrudRepository&lt;BookEntity, Long&gt; {<br><br>    fun findByAuthor(author: String): List&lt;BookName&gt;<br>}</pre><p>We update the return type of the findByAuthor method to return a list of BookName vs BookEntity. As a final step, we also update our print statement to print the projection method</p><pre>bookRepository.findByAuthor(&quot;J K Rowling&quot;)<br>   .<em>forEach </em><strong>{ </strong>bookName <strong>-&gt; </strong><em>println</em>(bookName.getName()) <strong>}</strong></pre><h4>Step 6: Projections in action</h4><p>Now when we run our app, we should see the following in the console:</p><pre>Harry Potter and the Chamber of Secrets<br>Harry Potter and the Goblet of Fire<br>Harry Potter and the Deathly Hallows</pre><h4>Step 7: Another Projection Method</h4><p>If we wanted to combine multiple fields from the BookEntity into a single field in our projection interface, we can update our getName() method to the following:</p><pre>import org.springframework.beans.factory.annotation.Value<br><br>interface BookName {<br><br>    @Value(&quot;#{target.name + &#39;, &#39; + target.yearPublished}&quot;)<br>    fun getName(): String<br>}</pre><p>And when we run the app we should see the following in the logs:</p><pre>Harry Potter and the Chamber of Secrets, 1998<br>Harry Potter and the Goblet of Fire, 2000<br>Harry Potter and the Deathly Hallows, 2007</pre><p>Spring data projections are that easy and convenient! For further reading please refer to Spring Data JPA’s documentation on <a href="https://docs.spring.io/spring-data/jpa/docs/1.10.1.RELEASE/reference/html/#projections">projections</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f4e56023795" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/spring-data-projections-6f4e56023795">Spring Data Projections</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Prepare for my Performance Reviews]]></title>
            <link>https://blog.devgenius.io/how-i-prepare-for-my-performance-reviews-246b97298488?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/246b97298488</guid>
            <category><![CDATA[performance-reviews]]></category>
            <category><![CDATA[software-engineer-life]]></category>
            <category><![CDATA[annual-review]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[software-engineer]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Fri, 28 May 2021 07:39:52 GMT</pubDate>
            <atom:updated>2021-05-28T07:39:52.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKhsYFFaW_TJQbEC6UeRaQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@nadir_syzygy?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Nadir sYzYgY</a> on <a href="https://unsplash.com/s/photos/momentum?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Performance/Annual reviews can be dauting. To go into a meeting to talk about your accomplishments and negotiate your salary is not easy. Its very hard especially if you are neither a fan of these nor does it come to you naturally. If you have been nodding, you have come to the right place (or so I hope)!</p><p>I want to share how I like to go about preparing for my annual review. This is not meant as do-this-and-you-will-be-successful. It is meant more as this-is-what-I-do-and-so-far-it-hasn’t-let-me-down. A lot of companies have helpful templates that help navigate performance reviews, but I still like to have a list of things I think about and use. So, I hope you also find my list helpful!</p><p>So, on that note, here is my list:</p><h4>Accomplishments</h4><p>There is no escaping this. We absolutely have to talk about how things have been going since our previous review. What contributions did we make etc. Some of the feedback I received a couple of years ago, was to not think of my accomplishments as “What did you do?”, instead to think of it as “How did you impact your team/company or teammate last year?”. This has been helpful for me because now the focus is off me! I don’t have to think in terms of “I did this and this and this……”. Instead I am thinking about “How did my team meet this goal and what were my contributions towards it?” or “How did I help onboard a new team member?” etc. The advantage of this method is two fold: One you are no more the focus and an even better advantage is you are now tying your contributions directly to impact.</p><p>Further this can be broken down by who it impacted:</p><ul><li>Team</li><li>Team member</li><li>Non team collegue</li><li>Company</li><li>Industry</li></ul><h4>Impact</h4><p>This might be covered in the previous section. But if not try to create impacts for your contributions. An example of a contribution could be “I mentored 5 people on this topic”. But the people on your review team might wonder that sounds great but what happened after that? So something along the lines of “I mentored 5 people on this topic, so they were able to join this project that used this technology and hit the ground running.” Tying my accomplishments to impact, value to the company/team is one of the best feedbacks I have ever received!</p><h4>Goals</h4><p>I don’t think a review is complete without setting goals for the year to come. Don’t make a million goals. Make about 3–5 of them and make sure to have them prioritized! I like to tie these goals to impact. While these goals help with personal growth, its helpful to tie these to impact on the team, colleagues and company at large!</p><h4>Review prior Goals</h4><p>If goals were set the previous year, definitely make sure to review them! Again tying your personal/professional growth to impact is very valuable!</p><h4>Feedback</h4><p>Make sure to collect feedback from your peers regarding your work the previous year! Here I like to ask targetting questions depending on who I am asking feedback from. For instance if I am asking my developer peers for feedback, then I like to ask them technical questions about my work. If I am asking my project manager, I like to ask about my role on the team and how I can grow my project skills. Of course a lot of these questions overlap but the focus is different depending on who I am asking. This helps ensure overall growth!</p><h4>Growth</h4><p>How have you grown in the previous year. Talking about things that helped you grow as a person or professionally, that you did not plan for. Make sure to include progress here and tracking metrics. Some questions to consider:</p><ul><li>Were there things you used to struggle with that you are getting better at?</li><li>How have you tracked that progress?</li><li>Where do you see yourself going as far as that goal/area of improvement is concerned?</li><li>Do you have feedback from your peers to support your observation? If yes include it as additional evidence!</li><li>And finally, at the end of the day how is this helpful?</li></ul><h4>Non-work related contributions</h4><p>Not all your contributions need to be strictly work related. We tend to think of everyday and directly impactful work contributions during annual reviews. But it doesn’t have to be just that! Things that are not directly work related but have an impact on your everyday work are very important and should not be ignored. Some items in this list include:</p><ul><li>Open source contributions</li><li>Speaking at local meet ups</li><li>Speaking at conferences</li><li>Community events</li><li>Mentorships</li><li>Writing blogs</li></ul><p>This is not an exhaustive list but I hope you get the picture.</p><p>As stressful as performance reviews are, they are one heck of an opportunity to look back at the year that went by and enjoy accomplishments and identify areas for growth. Personally, I like this part about performance reviews the best. It gives me a chance to look at the year that went by and think through how far I have come and look ahead at the path ahead.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=246b97298488" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/how-i-prepare-for-my-performance-reviews-246b97298488">How I Prepare for my Performance Reviews</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuration or AutoConfiguration?]]></title>
            <link>https://medium.com/javarevisited/configuration-or-autoconfiguration-ddb75a7b1548?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddb75a7b1548</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Tue, 30 Mar 2021 12:14:01 GMT</pubDate>
            <atom:updated>2021-03-30T12:14:01.636Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the difference between Configurations and AutoConfigurations in Spring boot!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xD2mCk0DBjyV6PRLUqZ82A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@grakozy?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Greg Rakozy</a> on <a href="https://unsplash.com/s/photos/magic?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Spring boot is all about magic. You add dependencies to the classpath and stuff just fits together and works. It provides a canvas for you to build on. The out-of-the-box configurations are opinionated and will make default configuration choices, at the same time these opinions and the configurations will be the first ones to get out of your way if you want to make your own configuration choices.</p><p>A lot of this magic because of <a href="https://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/reference/html/using-boot-auto-configuration.html">AutoConfigurations</a>. AutoConfiguration classes are very very similar to regular Configuration classes except for the following two differences:</p><ul><li>AutoConfiguration classes are run last (meaning after all regular non-autoconfiguration classes) while the order in which Configuration classes are run is indeterminate (except if we use ordering annotations like @Ordered)</li><li>To declare a class as an AutoConfiguration they need to be specified as such in the spring.factories file. An example can be found <a href="https://github.com/spring-projects/spring-boot/blob/v2.1.8.RELEASE/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories#L20">here</a>.</li></ul><p>By now I am sure you are wondering when should one choose an AutoConfiguration class vs a Configuration class. Great question! Personally, I like to use an AutoConfiguration when:</p><ul><li>The creation of beans depends on the presence of other beans. In other words, if you are considering using the @ConditionalOnBean or the @ConditionalOnMissingBean annotations.</li><li>Your configuration depends on other AutoConfigurations. You can use the @AutoConfigureAfter or @AutoConfigureBefore annotations to control the order of beans creation when it comes to AutoConfiguration classes.</li></ul><p>Let&#39;s look at some examples (and do some logging to understand the sequence of beans creation):</p><h4>Beans using only @Configuration</h4><p>Let&#39;s make some very very basic and simple examples. Consider two utility classes: StringUtils and ObjectUtils :</p><pre>class StringUtils {</pre><pre>    fun isBlank(value: String): Boolean {</pre><pre>      // Implementation here</pre><pre>    }</pre><pre>    // Other utility methods will go here</pre><pre>}</pre><pre>class ObjectUtils {</pre><pre>    fun isNull(value: Object?): Boolean {</pre><pre>      // Implementation here</pre><pre>    }</pre><pre>    // Other utility methods will go here</pre><pre>}</pre><p>Next, we are going to be creating a StringUtilsConfiguration class:</p><pre>@Configuration<br>class StringUtilsConfiguration {</pre><pre>    @Bean<br>    fun stringUtils(): StringUtils {<br>        logger.info(&quot;Running StringUtilsConfiguration&quot;)</pre><pre>        return StringUtils()<br>    }</pre><pre>    companion object {</pre><pre>       private val logger = Logger.getLogger(this.<em>javaClass</em>.<em>name</em>)<br>    }</pre><pre>}</pre><p>and an ObjectUtilsConfiguration class:</p><pre>@Configuration<br>class ObjectUtilsConfiguration {</pre><pre>    @Bean<br>    fun objectUtils(): ObjectUtils {<br>        logger.info(&quot;Running ObjectUtilsConfiguration&quot;)</pre><pre>        ObjectUtils()<br>    }</pre><pre>    companion object {</pre><pre>        private val logger = Logger.getLogger(this.<em>javaClass</em>.<em>name</em>)<br>    }</pre><pre>}</pre><p>If we were to run this <a href="https://javarevisited.blogspot.com/2018/05/the-springbootapplication-annotation-example-java-spring-boot.html"><strong>spring boot application</strong></a> you should see the following log statements:</p><pre>Running ObjectUtilsConfiguration<br>Running StringUtilsConfiguration</pre><p>In order to control the order of execution we could use the @Order annotation. But this is easy when there are only configuration classes. Ordering becomes hard if we had many configuration classes or if we need to conditionally create or not create beans depending on if other beans are present. Finally, if we want to provide defaults (E.g.: to provide defaults)- Enter AutoConfigurations.</p><h4>Introducing AutoConfigurations</h4><p>AutoConfiguration classes, as mentioned earlier, are a big component of what makes Spring Boot so effective. We can find several AutoConfiguration classes in Spring boot’s source code. Some example include: FlywayAutoConfiguration, GsonAutoConfiguration, MailSenderAutoConfiguration etc.</p><p>On a lot of these classes you may see some form of an @Conditionalxxx annotation. So these classes are executed when those conditions are fullfilled.</p><p>Let us start off with creating an AutoConfiguration and for simplicity’s sake let us change the StringUtilsConfiguration class to be an AutoConfiguration. The only thing we will need to do is register the StringUtilsConfiguration as an AutoConfiguration by creating a spring.factories file under the src/main/resource/META-INF directory:</p><pre>org.springframework.boot.autoconfigure.EnableAutoConfiguration=\<br>com.example.autoconfiguration.sample.ObjectUtilsConfiguration</pre><p>Now if we were to run the app, we will see that the ObjectUtilsConfiguration class will be run last, always.</p><p>This truly shines when a <a href="https://www.java67.com/2018/05/difference-between-springbootapplication-vs-EnableAutoConfiguration-annotations-Spring-Boot.html">configuration class</a> or even just the creation of a bean depends on the presence or the absence of some other bean. The @ConditionalOnBean would be an annotation to use, BUT from the documentation of the annotation:</p><blockquote><a href="https://docs.spring.io/spring-framework/docs/5.3.2/javadoc-api/org/springframework/context/annotation/Conditional.html?is-external=true">@Conditional</a> that only matches when beans meeting all the specified requirements are already contained in the <a href="https://javarevisited.blogspot.com/2012/11/difference-between-beanfactory-vs-applicationcontext-spring-framework.html#axzz6CgkxY2DJ">BeanFactory</a>. All the requirements must be met for the condition to match, but they do not have to be met by the same bean.</blockquote><p>As mentioned the @ConditionalOnBean only looks at the current state of the BeanFactory and not if the bean will ever be present in the application. So if the class that creates a certain bean that your configuration depends on another configuration, one option is to make your configuration an AutoConfiguration to make sure it is run after all other non-autoconfiguration classes. If your configuration depends on another AutoConfiguration, using one of @AutoConfigureAfter or @AutoConfigureBefore would help.</p><h3>Conclusion</h3><p>It is very VERY easy to create our own magic code similar to Spring boot to have things work “automagically”. But there eventually comes a point where it becomes extremely important to know and understand the difference between the options available to make that magic work. One such good-to-understand topic as far as <a href="https://medium.com/javarevisited/top-10-courses-to-learn-spring-boot-in-2020-best-of-lot-6ffce88a1b6e"><strong>Spring boot</strong></a> goes is AutoConfigurations for sure! And I hope my blog post, at the very least, scratched the surface :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddb75a7b1548" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/configuration-or-autoconfiguration-ddb75a7b1548">Configuration or AutoConfiguration?</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Error/Exception Handling]]></title>
            <link>https://codeburst.io/secure-error-exception-handling-6745c3945116?source=rss-906039a41916------2</link>
            <guid isPermaLink="false">https://medium.com/p/6745c3945116</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-security]]></category>
            <dc:creator><![CDATA[Janani Subbiah]]></dc:creator>
            <pubDate>Thu, 04 Mar 2021 02:12:39 GMT</pubDate>
            <atom:updated>2021-03-04T02:12:39.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UPqO0Qe0dDhlykRAMXk5g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@pablomerchanm?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Pablo Merchán Montes</a> on <a href="https://unsplash.com/s/photos/ice-cream-cone?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Error and exception handling are integral to every software application, no matter the functionality. Errors need to be meaningful, helpful, simple and help users understand what to do next (if there is something for them to do). But what if I told you that sometimes your error messages need to be presented at a high level without the intricacies of exactly what error occurred?</p><p>Securing applications is a Herculean task in and of itself. There really isn’t a one-size-fits-all solution across applications and within the different layers of a single application. When we talk about security, securing applications for happy path scenarios comes to mind first: User makes a request with incorrect credential(s) and application denies the request, if the credentials are correct then the application processes that request. This is important and kind of obvious. But what is less obvious is how we handle errors and exceptions in secure applications. How we handle exceptions also depends on which layer of security the user is at: Have they authenticated yet? Do they have the right permissions? etc.</p><p>Ideally, I would have liked to list out generic scenarios with recommendations on how to handle errors and exceptions but I feel like it might be more useful to talk about specific error handling scenarios in secure applications. But before we do that I want to oversimplify and talk about the two layers of security: authentication and authorization.</p><h3>Layers of Security</h3><figure><img alt="Flowchart depicting request processing in a secure application" src="https://cdn-images-1.medium.com/max/1024/1*We9LL6780Py6KzStINVzfg.png" /><figcaption>Request Processing in a Secure Application</figcaption></figure><p>Though you may have seen this over a million times, I don’t think I will be doing justice to this post if I do not specify authentication vs authorization. Authentication is verifying if you are who you say who you are and authorization is verifying if you are allowed to make the request you are trying to make (or access the resource you are trying to access).</p><p>With any secure software application, authentication is your first defense. If a user makes a request to access a protected resource (meaning valid auth credentials need to be provided for access), valid authentication credentials have to be provided, failing which the user should be denied the request. In the context of a ReST API service, such a request would result in a 401 error status code.</p><p>The next layer of defense is your authorization layer: The one where the application validates and verifies that the user (identified by their authentication credentials) can access the resource they are trying to access. This may not apply to all applications and if it did then it could be roles or permissions-based (OWASP’s cheat sheet on <a href="https://cheatsheetseries.owasp.org/cheatsheets/Access_Control_Cheat_Sheet.html">access control</a> may come in handy here). In the context of a ReST API service, such a request would result in a 403 error response. It is important to note that authentication failure results in a 401 while an authorization failure results in a 403 and this distinction is extremely important in conveying what needs to be fixed before the request can succeed!</p><p>Once a user successfully passes those two layers of defense, then comes all other validations on the incoming request. It is important to note that, in most scenarios, processing the request should be delayed until the user gets through the authentication and authorization layers successfully.</p><h3>Error/Exception Handling considerations</h3><p>So with the definition out of the way, let us talk about some important considerations for error/exception handling in secure application:</p><h4>Generic error message</h4><p>Error messages in the context of auth errors, in most scenarios, should be generic. Let’s consider login: If a user is trying to login using a username and password, and say they present a username that is valid but the password does not match what is currently stored in the backend, the error message for such a scenario should be generic. So something along the lines of “Login credentials incorrect” or “Username or password incorrect” should be preferred over “Password incorrect”. The latter exposes vital information: whether or not a username exists in the system. This allows a malicious user to use the login page to figure out if a user exists in the system. As an additional defense mechanism, one should consider implementing things like max login attempts, email verification, two-factor auth, etc.</p><h4>APIs that don’t require any security</h4><p>Depending on the type of application being built it is possible not all APIs require auth. There could be APIs that don’t require any security, meaning anyone can access these. Such APIs should take extra care to ensure error scenarios don’t result in exposure of secure information.</p><p>We can use our login example again here. Most applications do not require any auth to access the login functionality (think about the login page that displays text fields for users to enter a username and password). Users need valid auth to get past the login page but the actual login page itself is accessible to anyone on the internet. Security errors in such scenarios should not only be generic but also should make sure secure information is never exposed.</p><h4>Logging</h4><p>Logging is great. Logging is a requirement that allows developers to trace back what happened and figure out why. But, logs should not under any circumstance expose sensitive information in any form. All such information should be masked appropriately or not logged at all!</p><h4>Permissions should not be exposed</h4><p>As far as role/permission-based access control goes, it is good practice to let the user know what permissions they have vs what they need to access a resource. Let us consider an example:</p><ul><li>Say we have four permissions in our system: CAN_READ, CAN_UPDATE, CAN_DELETE and CAN_CREATE.</li><li>User A has the CAN_READ permission but any of the others.</li><li>User A tries to create a new resource (for which they would need the CAN_CREATE permission).</li><li>The error message in this scenario should say something along the lines of “Does not have permissions to perform this operation” and not get into the specifics of why maybe required to perform that task. This is just something to keep in mind and be aware of. There might be scenarios where this does not apply but understanding the risk of exposing permissions helps makes informed decisions. This is also a matter of personal preference: When it comes to security being minimalistic in what is exposed is safer.</li></ul><h3>Conclusion</h3><p>These scenarios are <strong>NOT</strong> an exhaustive list. There are several other security-related error scenarios where extra care is required for error handling. I highly recommend reading <a href="https://github.com/OWASP/CheatSheetSeries">OWASP guidelines</a> while building any software application. It is one of the best aggregations of security-related information in a single location. I hope this post can get us all to start thinking about the error and exception handling with regards to security in a new light where sometimes the lesser the information exposed, the more secure (and better) it is for the application!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6745c3945116" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/secure-error-exception-handling-6745c3945116">Secure Error/Exception Handling</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>