Wednesday, June 11, 2014

Future of Enterprise Applications Development

This is something I came to know while working with Weblogic for past few years. Over the years weblogic has developed quite a bit from one of its oldest version 6 (formerly known as BEA and before that known as Aqualogic) to Weblogic 12 (currently known as Oracle weblogic).

David Moyes might have left Manchester United in a mess this year (2013-2014), but oracle has done its bit to enhance Weblogic for its betterment. The most stable version currently in industry standard is 11g (10.3.6). Forgive me for showing my untiring effort to link Football to Weblogic, which are no way related, but one more expensive player bought on board by Oracle is Sun Java. And as a branch of Oracle Java is growing very fast and although Java 6 is considered as an industry standard now, there is already a new version of Java 8 already released in March 2014.

Now, naturally the question is where am I leading you to? The point I am trying to make is, the version of Java that comes for the latest Weblogic is still Java 6. Although you can use Java 7 in weblogic 12c (http://docs.oracle.com/cd/E24329_01/doc.1211/e24492/jdk7.htm), as of now we haven’t seen Weblogic using the full potential of the new Java versions. All features available might not be of use, but features like new concurrent Garbage Collector , improved compiler warnings etc would mean a vastly improved Weblogic application server with less and less memory issues for heavy enterprise applications.

And the latest in this is Java 8 which boasts of a very small JVM of 3MB. These features combined with the new improved weblogic GUI, security features gives enterprise applications a huge boost in terms of performance and ease of handling. What I am looking forward to is coming days with a complete package having the latest version of all the products required for enterprise application development. A Language (Java),an Application Server (Weblogic), a database (Oracle Database) and an IDE (NetBeans). This might act as a Commercial Of the Shelf (COTS) product for oracle and would standardize the process starting from development till deployment. Although this might sound as taking away the flexibility of the individual options that you can have but it is more to make an industry acceptable standard for enterprise architecture while free lancers and open source community continuing their adventure to explore new avenues and improve the standard in future.


Saturday, May 24, 2014

Do it my way ...

Every body like to do their work in their own way, and others to follow their way. If not everybody, certainty most of the people. The art of making others doing the work in your way is called managerial skill, leadership etc .. No need to worry I am not getting some sort of management concepts.
We programmers  do copy the real world arrangement and behaviors to solve software designing problems. So the idea of one program,module and class controlling the way other behave is quite natural. Dependency injection is the well known way of doing such thing.
In Java it used to happen through interface and abstract class. Anonymous class is widely used to define the concrete class for such interface or abstract class.

JButton testButton = new JButton("Test Button");
     testButton.addActionListener(new ActionListener(){
     @Override public void actionPerformed(ActionEvent ae){
        System.out.println("Click Detected ...");
       }
     });

In the above code we are creating an anonymous class which extends  ActionListener. This is a commonly used technique. In Java 8 this whole concept is more formalized into lambda expression. We can re-write the previous example

JButton testButton = new JButton("Test Button");
testButton.addActionListener(e->System.out.println("Click Detected ..."));

Lambda expression simplifies the code significantly. Lambda expression is used when we have to implement a functional interface. Functional interface means interface with only one method to be implemented.
So the advantage of lambda expression over anonymous class is it reduce the lines of code.

Happy Coding ;)

Thursday, September 26, 2013

Encrypted JDBC connection with Oracle Database

To protect sensitive data encryption is the standard way. Its highly recommended if you are dealing with sensitive data, the application database connection also need to be encrypted. In this article we will go through how to establish a secure JDBC connection to Oracle database.

 1) We need to turn on encryption in oracle server. We can do that by starting Oracle Net Manger. There we have to select Oracle Advance Security and in Encryption tab there is option to turn on Encryption for server.

2) Once the encryption for server is turned on. Next is how to establish a secure connection from Java.
JDBC driver has the capability to establish a encrypted connection. we have to pass necessary information as part of properties to do so. Here is documentation for that.

In this way we can establish encrypted connection. To test whether its working or not, we have to install some network sniffer tools. By that we can verify the exchanged data is encrypted or not. Another way is by turning on the tracing in Oracle Net Manger for network communication. And to check those trace for network traffic data is encrypted or not.