Author Archives | Mohamed Sanaulla

About Mohamed Sanaulla In his day job he works on developing enterprise applications using ADF. He is also the moderator of JavaRanch forums and an avid blogger. ( subscribe )

Primary and Auxiliary Constructors in Scala

June 29, 2012

2 Comments

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 [...]

email

Package Objects in Scala

June 28, 2012

0 Comments

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

0 Comments

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

0 Comments

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

2 Comments

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

1 Comment

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

1 Comment

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

0 Comments

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

2 Comments

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 [...]

JavaBeat Newsletter-2: New and noteworthy in Java Ecosystem

June 18, 2012

0 Comments

Interesting blog posts from JavaBeat: Exploring the enhancements to the java.nio package as part of Java 7 we wrote about watching a directory for changes and also looked at few methods in the Files class. Writing agents in Java to instrument the class files/byte code. Using Fork-Join framework introduced as part of Java 7. Getting [...]