Scala

Akka Actors on Mac beating the S#!t Out of my Dell

Reading Time: 2 minutes Let me explain the scenario. We have n (tens, hundreds or thousands) of Akka actors listening to a queue on RabbitMQ server. So the scenario looks something like this AMQP.newConsumer(connection, ConsumerParameters("*", actor, Some(queueName), Some(exchangeParameters))) As you would notice, each of the actors gets a message from the Q and invokes a plugin to do the processing and returns the results back to the result Q. Continue Reading

Creating Object Pool(s) in Scala

Reading Time: 3 minutes We are currently working on a very exciting web scale project. The framework is built using Scala and Akka actors and till date we are quite pleased with the performance. The architecture is plugin based where we can dynamically add plugins to our framework for processing incoming messages. Now, this is where it gets interesting and is the reason for this post. Some of the Continue Reading

Scala Nuggets: Finding All Classes in a Package

Reading Time: 2 minutes Recently, while doing a project for one of our clients in the US, we had the opportunity to build a plugin based framework for the product. While, the details of the plugin framework are reserved as a topic of another post, in this one we would see how easy it is to find all the classes in a package using a utility provided by Clapper. Continue Reading

Working With Scala Collections

Reading Time: 2 minutes We have a monthly iBAT (Inphina Beer and Technology Sessions). We look forward to this day and it was Scala day this time. I presented on Scala collections. Scala collection is elegant and concise. Scala Collections like java is object-oriented and we can work with generic types. It is optionally persistent i.e can be mutable and immutable. It provides higher order methods like foreach, map Continue Reading

Scala Nuggets: Understanding Traits

Reading Time: 4 minutes Inphina provides specialized Scala consulting, training and offshoring … Learn more about Scala@Inphina! If you are coming from a Java background, then traits are interfaces++.  In scala, trait is a complete mixin solution where we can provide implementation in the trait as well as have classes mix-in the trait either when we declare classes or even when we are creating an instance of the class. Continue Reading

Creating a Scala Project with SBT and Working in Eclipse

Reading Time: 4 minutes Inphina provides specialized Scala consulting, training and offshoring … Learn more about Scala@Inphina! There are numerous view points on the use of Maven or sbt for creating Scala projects. If you have been working on Java projects for a long time then your favorite has to be Maven unless it is Ant. Still Ant 😉 But there are several advantages of using sbt, including the Continue Reading

Working With Scala Test

Reading Time: 5 minutes Scala Test is an open source Test framework for the java platform. With Scala test we can either test java or Scala code. It integrates with popular existing tools like JUnit, TestNG and it is designed to do different styles of testing like Behavior Driven Design for example. Let’s have a look at a simple JUnit4 Test in Scala Test package com.inphina.ibat.junit import org.scalatest.junit.AssertionsForJUnit import Continue Reading

Scala Nuggets: Look Ma! My First DSL

Reading Time: 2 minutes DSL (Domain Specific Language) is a programming language or specification language dedicated to a particular problem domain, problem representation or a particular solution technique. So with a few Scala Nuggets on our way we are ready to write a DSL? Not quite but in this post we would touch upon a critical feature in Scala which makes writing DSL’s easy. Let us look at the Continue Reading

Scala Nuggets: Avoiding the Billion Dollar Mistake of Null

Reading Time: 2 minutes Historically, the use of null has often been referred to as the billion dollar mistake. It has led to more problems than solutions Tony Hoare introduced Null references in ALGOL W back in 1965 “simply because it was so easy to implement”, says Mr. Hoare. He talks about that decision considering it “my billion-dollar mistake”. Let us look at the following code in Java which Continue Reading

Scala Nuggets: The Tasty Tuples

Reading Time: 2 minutes One of the interesting things that Scala has to offer is a concept called Tuples. It is a literal syntax of comma-separated list of items inside parenthesis. Something like (a1, a2, a3). These “groupings” are instantiated as scala.TupleN instances, where the N is the number of items in the tuple. The Scala API defines separate TupleN classes for N between 1 and 22, inclusive. (I Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!