Sunday, March 15, 2015

Getting started with ESP8266 (Cheap WiFi module)

I brought a ESP8266 module from ebay. The whole purpose was to do some experiments with it and understand how to use it in my micro-controller projects. I was not interested in XBee products since those were much expensive compared to ESP8266.

Initially I started with issuing AT commands from my laptop to the WiFi module. To do this I brought a USB to TTL serial adapter.

Saturday, January 12, 2013

Data Access With Spring JDBC (Note 1)

When developing enterprise applications, we have lots of options when it comes to the implementation of the DAO (Data access Object) layer. Either we may use an ORM framework like Hibernate, iBatis or pure JDBC. 

JDBC fulfills almost all the necessary data access requirements. and provides low level access to the data access operations. But we have to handle connections and lots of other things. 

Friday, January 11, 2013

Playnig With HTTP Methods

I am highly interested in RESTful web services these days :) . So I tried to implement my own RESTful API and wrote REST client to communicate with the service. GET, POST, PUT, DELETE are basic HTTP methods used in REST services (details of HTTP methods can be found here) . Lets see how I implemented basic CRUD operations using HTTP methods.

For the sake of simplicity I have simply echoed the request body and selected request headers back as the service implementation.

Monday, December 17, 2012

Using SQLite with JDBC

I had to implement an application which should utilize a portable database. For better portability the application was implemented in java. As my first choice I selected several flat files for storing data in a hierarchical manner .

At the run time of the application , read operations were much higher than the write operations. It took minutes for traversing and search through each file on a search operation.

Considering all above facts I selected "SQLite" for storing and managing data in my application. Though it was bit slow while feeding data to the application , it was pretty fast when reading data from the database.

Thursday, December 13, 2012

Monitoring JDBC Performance with JDbMonitor

There may be some situations where we need to monitor our JDBC calls. There are few mechanisms available for monitoring JDBC calls. I have tried JDbMonitor in some of my projects because it is easy to use and remove without any code change.

JDbMonitor works as a proxy between our application the JDBC driver. Essentially there may be some performance issue if we use this in a production environment. JDbMonitor provides a GUI application to monitor our JDBC calls.

Tuesday, May 29, 2012

XML Serialization With XStream

XML Serialization is essential in some situations. Most probably we may use XML serialization when we need higher level of portability. XStream is a great library for xml serialization.
Serializing

Monday, April 23, 2012

Ajax with Dojo

It is very safe to use Dojo like java script frameworks for Ajax operations since they ensure browser compatibility. We don't have to change the code based on different browsers. dojo will handle those stuff for us. Any way , If we are using such java script frameworks for Ajax operations  we must carefully choose a proper framework with wide range of browser support.

In this example I have used a very simple Servlet and a simple HTML page to demonstrate the client server model.

Friday, April 20, 2012

Browser Automation With Selenium

Selenium is a browser automation framework. it is available in many flavors such as Java , .net , python . I am interested in Java implementation of Selenium.  Selenium can be successfully used in regression automation. It provides all the necessary functionalists required to automate the browser. Such as navigating, verifying, drag and drop,  clicking , selecting..etc.

Selenium can be downloaded from here
Getting started guide

Tuesday, April 3, 2012

Log4j In Action

Logging is very important for the maintenance of  a deployed application. Just assume a situation that we deploy our application on the client systems and work on another project. After some time client reports a failure of our system. What will happen if we haven't maintained a log file! We may be in a big trouble in such situations. It may be very hard to track where the bug occurred. Because we haven't any IDE's , debuggers on deployed machine.

So it is always recommended to use a logging mechanism for large applications. Logging may be a overhead if we don't use it carefully. We can use logging inside exception handling blocks.

Monday, April 2, 2012

Dependancy Injection (Spring Note 1)

Just assume a situation where we have to develop a module that must generate different types of reports such as PDF reports, Excel reports. One of a worst design for such scenario is design classes for each report separately without any form of polymorphism. Such a design may may result in increasing coupling of the program.
example :
ExcelReport excelReport=new ExcelReport();
PDFReport pdfReport=new PDFReport();

excelReport.initialize();
excelReport.createReport();
excelReport.saveReport();

pdfReport.initialize();
pdfReport.createReport();
pdfReport.saveReport();

© kani.stack.notez 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis