Welcome to my blog

I blog my interests and opinions here.

Wednesday, November 24, 2010

JON (JBoss Operations Network) for performance monitoring vs application migration

JON is a lightweight performance and server monitoring tool offered by the JBoss community. JON agents could be configured to discover JBoss servers such as JBoss Web and JBoss EAP in order to visually monitor the performance of the various applications. JON could monitor the classes, memory usage, CPU usage and so on.

Although JON could be used to run scripts fo automation of application releases, it would not be the best tool for that. Especially when there are continious integration tools such as Hudson. The JON command line interface (CLI) tool allows to run javascripts to communicate with the JBoss Server and release web archives (WAR), enterprise archives (EAR) and so on.

Tuesday, November 23, 2010

Jboss Mod Cluster with Apache Httpd

Setting up a load balancing environment with Apache 2.2 (a web server that acts as reverse proxy for JBoss), JBoss Web 2.1 (Jboss version of Tomcat) and Jboss EAP 5.1 is quite easy.

The AJP connector for JBoss would automatically hookup with the Apache Httpd web server if the parameters were correctly specified in the conf/httpd.conf file.

Detailed instructions on seeting up mod cluster is available at the link http://docs.jboss.org/mod_cluster/1.0.0/html/ and the following link has step by step instructions on setting up mod cluster https://access.redhat.com/kb/docs/DOC-34508 (this link would require registration at the Red Hat Customer Service portal)

Monday, November 22, 2010

JAAS Login Module pros and cons

Using a Java Authentication and Authorization (JAAS) login module for authentication and authorization is a great way to separate the authentication layer from the rest of the application. Some pros of using JAAS are
a) Layering improves performance.
b) Fail over handled seamlessly using JAAS login module chaining.
c) Multiple stores could be used like LDAP, database, properties file.
d) Having the authentication and authorization happen in one step reduces the burden on the developer.


Some of the cons of using JAAS are
a) In web applications accessing the Http Session object could be a hassle in the custom JAAS login modules.
b) Propagation of the JAAS authentication Subject to other layers is not easy.
c) Having the authorization in JAAS could be restricting for applications where multiple sections of the application could be require separate authorization.

Thursday, November 18, 2010

Mediator pattern and coupling

The mediator pattern in a behavioral pattern unlike structural patterns such as facade and adaptor.

Mediator Pattern: In layman's terms a mediator is a person who acts as a point of reference between parties. In the same sense a mediator class is one that acts as a point of reference between two classes that depend on each other. In an environment where the requirements and the system design is continuously changing such a design pattern is used.

Introducing a mediator reduces the coupling between the classes thus making maintenance of the application relative easy.

Wednesday, November 17, 2010

Difference between Facade pattern and the adaptor pattern

Both the facade and adaptor patterns are structural patterns.

Facade Pattern: In layman's terms the facade pattern could be thought of as the front end of a building. The facade pattern provides a single interface for various calling clients. It organizes the code in a better more readable fashion, hides the inner working of the system and reduces the network traffic.

Adaptor Pattern: The adaptor pattern could be thought of as a power adaptor used in UK for a device that is meant to work in USA voltage. In the adaptor pattern the calling client uses the adaptor as a single interface to perform the same operation. The adaptor in turn decides which operation should be called based on the environment.

The conclusion is that the facade pattern provides a single interface for multiple operations and the adaptor pattern provides a single interface for the same operation.

Thursday, November 11, 2010

Desert Code Camp on 11/13 at Gilbert

It is always a nice experience at the code camp as I get to see how the Microsoft technologies are innovating the world of RAD as compared to Java. It seems like there are some interesting sessions on RESTful services and enterprise architecture that I would like to attend.

Wednesday, November 10, 2010

Service Oriented Architecture (SOA) and Cloud

In the world of cloud computing service oriented architecture (SOA) is something that has revolutionized the world of internet programming.

Take the example of the Amazon Web Services (AWS: http://aws.amazon.com) that allows developers to connect and get information about items sold at Amazon. Talking about AWS I remember an application that I wrote in order to talk to the AWS for retrieval of the book details based on the ISBN. I also published an article on ASP Alliance on this.

Object oriented analysis and design

I am a strong believer in thinking object oriented. Given a real life problem, the solution becomes clearer when it is broken down using the OOAD principles Abstraction, Polymorphism, Inheritence and Encapsulation (A PIE).

Although several books and materials on the internet explain these concepts in a more technical manner, I think that things are clearer if we looked at it from a layman's perspective using an example of a small business.

Abstracion: To be more specific lets look at the payroll processing system in a small business. Any payroll processing system would have some common operations such as check balance and process payroll. These general operations could be classified as abstraction.

Polymorphism: In the payroll processing system the operation process payroll could be handled in different ways. The first one being process payroll using direct deposit and the second being process payroll with check. This could be classified as polymorphism.

Inheritence: In the payroll processing system there could be two different branches one in Arizona and the other in New York. Both the branches would process payroll by inheriting the common behavior from the parent but implement the payroll processing in different ways (as the state taxes etc. could be different). This could be classified as inheritence.

Encapsulation: In the payroll processing system when the payrols is being processed for an employee the information such as state taxes would be encapsulated. Such a data hiding technique could be classified as encapsulation.

As we can see the complex payroll processing system in not so complex anymore when looked at using the "A PIE" principle of OOAD.