Attending: DevCamp Pune 2011
DevCamp Pune - The Developer Community Meet Pune,
April 9th, 2011 | 10:00 am - 6:00 pm
Register here
DevCamp Pune - The Developer Community Meet Pune,
April 9th, 2011 | 10:00 am - 6:00 pm
Register here
Posted by
Atul Shinkar
at
1:50 PM
0
comments
Labels: Events
The java.beans package provides very useful classes [XMLEncoder / XMLDecoder] to save an object state [persist] into an XML file [Serialize] and easily read it back [De-serialize]. It's very helpful while debugging the state of objects especially in the production environments.
Posted by
Atul Shinkar
at
1:03 PM
0
comments
Labels: -C-O-N-C-E-P-T- Series, Java
We know that Distributed Computing is all about building network-based applications as a set of processes that are distributed across a network of computing nodes that work together to solve a problem. The advantages of this approach is like performance improvement, resource sharing, fault tolerance, scalability, etc. But still, to achieve this, special care should have to be taken while design and implementation of such systems. There are many challenges in distributed computing like synchronization of process across heterogeneous networks, network latency, partial failures of processes and language incompatibilities.
JavaSpaces technology, to the rescue...
1. JavaSpaces is both, distributed programming model and an API.
2. It's a high-level coordination tool for gluing processes together into a distributed application.
3. JavaSpaces are best considered as distributed shared memory with additional features which provide transactional integrity and support for the handling of failure.
4. In JavaSpaces applications, processes don't communicate directly, but instead coordinate their activities by exchanging objects through a space, or shared memory.
5. A process can write new objects into a space, take objects from a space, or read (make a copy of) objects in a space as shown in figure below:
6. JavaSpaces uses the most common software pattern, the Master-Worker pattern. The Master hands out units of work to the 'space', and these are read, processed and written back to the space by the workers.
7. JavaSpaces provides a simplified approach to dynamic communication, coordination and sharing of objects between network resources.
Some useful pointers to know more about JavaSpaces:
Link1, Link2, Link3
Posted by
Atul Shinkar
at
10:03 AM
0
comments
It's been long break from my last post... Hope such break doesn't occur this time round :)
Posted by
Atul Shinkar
at
9:52 AM
0
comments
On Friday, Mar 5th, 2010 attended ThoughtWorks TABS (ThoughtWorks Agile Business Series) session on "Agile and Lean Concepts for IT Professionals". It was a great piece of experience. They took all the attendees to the actual Project teams and showed how their teams are agile. Followed by that was the session on "Lean Concepts for IT" by Scott Shaw. It was a really informative session.
Now looking forward for ThoughtWorks Master Class Series talk on "10 Ways to Improve Your Code" by Neal Ford on Wednesday, Mar 10th, 2010.
Posted by
Atul Shinkar
at
9:56 AM
0
comments
Labels: Events, Technical Talks
Today I attended Intel's - Software Developer Supercomputing Conference, 2009. It was a really great conference. Lot of ideas were shared by intel people like how to improve application performance using threads, libraries (like MKL-Math Kernel Library), using their new products, etc. etc.
The session was interactive enough and at the last they distributed Intel's T-shirts :)
Some useful pointers:
whatif.intel.com
go-parallel.com
Posted by
Atul Shinkar
at
3:35 PM
2
comments
Labels: Events, Technical Talks
Today I came across bleeding edge research of the year 2009 - Pranav Mistri's "sixth sense". It's a simple, wearable device that enhances the real world with digital information.
Great to see future developments in this area..
Posted by
Atul Shinkar
at
2:17 PM
1 comments
Labels: New innovations around, Open Source
On November 3, 2009, J2SE 5.0 reached its End of Service Life (EOSL), which is the date of final publicly available update of version 5.0 (i.e. J2SE 5.0 Update 22).
You can find more information here.
Learn more about EOL policy here.
Posted by
Atul Shinkar
at
2:07 PM
1 comments
Labels: Java
Dave Thomas took the idea of coding practice and made something very well, pragmatic out of it.
There are series of katas, which are small, thought-provoking exercises that programmers can do in the language of their choice.
You can find it here. Really worth giving a try :)
Posted by
Atul Shinkar
at
12:04 AM
0
comments
In one of my older post [here], I discussed about the power of Fluent Interfaces. We can use those in building method chaining, thus improving the readability of code just english-like sentences.
We can also implement this using "return this" in class methods.
Take a look at below source code:
Bug.java
CreateBugs.java
Output:
The above programs are self explanatory :)
Posted by
Atul Shinkar
at
6:27 PM
0
comments
Labels: Java
When we execute a query in oracle, a ResultSet is created and stored in the memory. Oracle allows the programmer to access this ResultSet in the memory through cursors.
When we fire SELECT query / DML query from Java code, Oracle returns the reference of this created cursor to the Java program, which we refer as a ResultSet. Following is the hierarchy of creating objects in JDBC:
Posted by
Atul Shinkar
at
12:36 PM
3
comments
Labels: Java
In one of our project, we were storing frequently used application related data into the session, but now as the project is growing incrementally, storing new data / modifying existing data into session has became very confusing and difficult to manage.
I was just thinking about the workaround for coming out of this havoc, and voila, I got one :). This workaround I've implemented in our project. I would like to share the idea which brought us out of this mess.
Idea (Workaround): We can use one singleton java class, which has one HashMap variable. There will be custom methods for getting, setting and removing (operations same as that of session operations) values from HashMap. Now we can use this implementation for storing data (which was supposed to be stored into the session) into the HashMap present in this class, and then we can put the object of this java class (we'll be having one object for each session) into the session. So, at the session level, there will be only one object present in the session, and now it's lot easy to maintain and manage session variables (now HashMap data). Also, there will be only two session operations in each class, first: getting this java class object from session, second: storing back this java class object back to the session.
Implementing this thing was really fun and gave us lot of flexibility to maintain and manage session variables... :)
Posted by
Atul Shinkar
at
2:31 PM
0
comments
Labels: Java, My Explorations
Difference between using "" and toString() method for converting object value to String:
Case I - Using "":
-----------------------------------------------------------------
BigDecimal dec = new BigDecimal("1234567");
String str = "" + dec; // converting dec to String
System.out.println("str: "+str);
o/p:
str: 1234567
-----------------------------------------------------------------
-----------------------------------------------------------------
BigDecimal dec = null;
String str = "" + dec; // converting dec to String
System.out.println("str: "+str);
o/p:
str: null
-----------------------------------------------------------------
Case II - Using toString() method:
-----------------------------------------------------------------
BigDecimal dec = new BigDecimal("1234567");
String str = null;
if( dec!=null ) {
str = dec.toString(); // converting dec to String
}
System.out.println("str: "+str);
o/p:
str: 1234567
-----------------------------------------------------------------
-----------------------------------------------------------------
BigDecimal dec = null;
String str = null;
if( dec!=null ) {
Posted by
Atul Shinkar
at
7:10 PM
0
comments
Labels: -C-O-N-C-E-P-T- Series, Java
Blogging after a long-long-long-... time :)
When we fetch records from HashMap, it gives records according to hash code, i.e. the records returned are not in the order when they're placed in the Map.
When we fetch records from TreeMap, it gives records in the sorted order of key, i.e. the records returned are not in the order when they're placed in the Map.
What I want was a Map that should return sequential values/objects that are put into when they're fetched. So, why not to make our own custom implementation of Map that does what is needed.
I constructed following Custom Map Implementation. Please find the code below:
CustomMapImpl.java
===
Supporting Class: CustomEntrySetImpl.java
===
Output of above program:
key1 : value1
key2 : value2
key4 : value4
key5 : value5
key6 : value6
key7 : value7
---
It was a very great experience. I also digged into the actual Java Map source code which was an amazing experience.
Posted by
Atul Shinkar
at
5:59 PM
4
comments
Labels: Java, My Explorations