Author: Vidisha Gupta

Case Class Inheritance

Hello friends, as discussed in the previous blog we know what are case classes and what boilerplate code do they generate. Now in this blog, we will be discussing case class inheritance, how it can be achieved as the case to case inheritance is prohibited due to the equals and hashcode method case classes generate. We will also be telling the bad side of case classes. scala> Continue Reading

What is Uniform Access Principle?

Uniform Access Principle is a programming concept which was first introduced by Bertrand Meyer which stated that All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation. The principle simply means that the notation used to access a feature of a class shouldn’t differ depending on whether it’s an attribute or a Continue Reading

Case Class In Scala

Case Class is one of the great tool introduced by Scala in the functional programming world. case class Book(id: Int, title: String, isbn: Long) Let’s explore what’s hidden behind the above class. Case class is similar to a class but it provides a lot of boilerplate code for developers to use. By default, they are immutable i.e. once declared cannot be changed. If we compile Continue Reading

%d bloggers like this: