Constructors in Scala are a bit different than in Java. Scala has 2 types of constructors: Primary Constructor Auxiliary Constructor Primary Constructor In Java we have a no-args default constructor which is provided for every class which doesn’t provide its own constructor methods. On a similar lines Primary Constructor in Scala is the kind-of default [...]
Archive | June, 2012
Package Objects in Scala
June 28, 2012
Package Objects in Scala was introduced as part of Scala 2.8. With this feature a package in scala can contain field declarations, methods along with the classes, objects and traits. The methods and variable declarations are put into the package object and are accessible in the package for which the package object was declared. Lets [...]
Implementing a Producer-Consumer scenario using BlockingQueue in Java
June 27, 2012
Before we start with the actual example, lets have a look at the few concepts we should be aware of. Producer-Consumer Problem Wikipedia here says that: The consumer producer problem (also known as the bounded-buffer problem) is a classical example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, [...]
Fields which satisfy JavaBean specification – BeanProperties in Scala
June 26, 2012
We have seen previously about declaring fields in classes in Scala and also saw the kind of bytecode created for each of the cases. But lot of Java tools out there expect the fields in classes to follow the JavaBeans specification and in order to support that Scala provides @BeanProperty annotation. BeanProperties in Scala Lets [...]
Understanding Classes and its Fields in Scala
June 25, 2012
For those moving from Java to Scala would find it a bit different to see how the classes and their fields are treated in Scala. Most of you in the Java world always complain about the verbosity of adding fields and then to add their getters and setters. Lets look at how the Classes and [...]
CRUD Operations in Gaelyk- Part 2- Read Operation
June 24, 2012
In our previous post we saw about implementing Create operation for creating a new entity and persisting to the database. In this article lets see how we can retrieve all the entities stored in the datastore. This would be the Read operation from the CRUD operations in Gaelyk Read- CRUD Operations in Gaelyk We would [...]
CRUD Operations in Gaelyk- Part 1- Create Operation
June 23, 2012
We have seen here and here on creating simple mashup using Gaelyk. In this series of articles lets see how we can implement CRUD operations in Gaelyk. CRUD Operations in Gaelyk would involve: Create an entity Read an entity Update an entity Delete an entity In this article we will look at creating an entity [...]
Creating JSON using Groovy
June 22, 2012
I wrote previously about parsing JSON in Groovy. In this article I show a simple example of creating JSON using Groovy. I had to learn about creating JSON using Groovy as I would be using JSON as the response format in the REST API which might be developed sometime in future. Creating JSON using Groovy [...]
Creating, Writing, Reading files using Java Files API of Java 7
June 20, 2012
In our previous post we did get a taste of the power of the static APIs in the Java Files class and we managed to compare the code written without using the APIs in Java Files and with using the APIs in Java Files. In this post let me delve further into the other APIs [...]
New features in JDBC 3.0
June 18, 2012
This article provides an introduction to the array of core new features available in JDBC 3.0. More specifically, the features ‘supporting save points’, ‘using parameter metadata’, ‘updating large objects’ and ‘auto generated keys’ are discussed. Wherever possible, to get a hang of it, relevant code samples have been provided in the respective sections. Download Source [...]






June 29, 2012
2 Comments