Insights and perspectives to keep you updated.

Decorator Design Pattern

Hi everyone! In this blog, we are going to discuss decorator design patterns with Scala. Let’s say I own a pizza outlet and we know that everyone has a very different taste and so there can be various combination of toppings. If I have n number of toppings, so i will have to create p(n) = 2 * p(n-1) + 1 Subclasses.

The Rise Of Scanamo: Async Access For DynamoDB In Scala

Scanamo is a library to use DynamoDB with Scala in a simpler manner with less error-prone code. Now the question is  “Why should anyone use it?” The answer is very simple. As DynamoDB clients provided by AWS are not available in Scala DSL. So there are a number of libraries available for DynamoDB to write your queries in Scala. But what makes Scanamo different from other Continue Reading

Mocking Methods for Testing Akka Http Routes

Hey folks, in this blog I am going to explain how to write unit test cases for the routes in Akka Http. First and foremost the test cases should not hit our backend logic, remember that we are only testing our routes, routes basically form the controller layer in our application. They control the request/response cycle. They tell that which business logic should respond to Continue Reading

Back2Basics: Scala Extractors in Detail

While working with the Case Classes closely, we have a very concise way to decompose an entity using pattern matching. The potent example is pattern matching on the Some(x) and None, as most of us know they are case class and case object respectively. The potential question that we have is do we have a provision to use similar patterns without having an associated case Continue Reading

Distributed Transactions and Saga Patterns

In a Knolx session organized by Knoldus, we discussed the idea of following Saga Patterns. For that to be more accessible, I’d like to share the session with the help of this blog. Service-oriented architecture has given us enough advantages to be a predominant architecture in our Industry, but it can’t be all sunshine and rainbows. There are use cases where monoliths are not only Continue Reading

Working with Rust: Understanding struct, impl, methods and self

While working with any programming language, we always have a requirement of creating custom data types. If you are familiar with any object-oriented language, there are classes that comprise data attributes and some methods to play with their context. The objects of these classes are used for reflecting the behaviors. Like other languages, Rust also provides us with all these flexibilities, but in its own Continue Reading

RUST can never be NULL

You might not know NULL was born more than a half-century ago, and it is still alive to create the mess for us, but not with RUST. Although it was considered to be BOOM for the coders, now it’s becoming a BANE for the programmer. With the emerging languages, creators are avoiding the implementation of NULL now. The inventor of NULL Tony Hoare[2] apologized for inventing it Continue Reading

Setting up cucumber and sbt in IntelliJ

If you want to look into a starter project where cucumber feature file can be run right from IntelliJ IDEA with sbt as a build tool, this blog is a perfect match.  I will put the below ingredients and complete recipe on how to write a feature file and plug it in with your implementation steps in IntelliJ IDEA. Ingredients: build.sbt First three lines may Continue Reading

Macros in Rust #1

Macros: Basically, macros are a way of writing code that writes other code, which is known as metaprogramming. I have also used ‘println!()’ macros in my previous blog. Here macros expand to produce more code than the code you’ve written manually. Metaprogramming helps us to reduce the amount of code we write and maintain.

ScalaFP: Firsthand With Scala-Cats Monads – #1

In the previous post, we had a look at the reasons behind the monads and how monads can help us design the programs in a functional style. Now we are going to explore some of the monads which are frequently used in the applications but not available within the Scala predefined libraries. We will be exploring the monads which are provided by the scala-cats functional Continue Reading

RUST: Begin the Journey with CODE

Hope so you have already gone through the first blog “RUST: Quick Start & Exploring Cargo” and ready to workout with your fingers and keys. You might be thinking about the basic programming concepts of RUST as a language. With the help of an example, I will try to cover the following points (practically): mutable, immutable variables Standard input/output (console) Functions Data type and conversion Loops: Continue Reading

Why Rust & What Is Rust

Why Rust?  In system programming languages we basically face two complex problems which are difficult to crack i.e. Secure and Multithreaded code. For this Rust has added its own goals of memory safety and data-race-free concurrency. What Is Rust?  Rust is a System programing language sponsored by Mozilla which describes it as a “safe,  concurrent and practical language,” supporting functional and imperative-procedural paradigms. It basically Continue Reading

RUST: Numeric Data Types

You must be wondering what is so special about numeric data types in RUST, that we are focusing on them so much, definitely, you will get to know after finishing this blog. Generally, other programming languages follow short, int, float, long, double etc as numeric data types as per their storage size and capacity while in RUST numeric data type are like : i[size_in_bits] or u[size_in_bits]  Here, i Continue Reading

%d bloggers like this: