Getting started with IoC – A simplified tutorial

I had mentioned about Inversion of Control (IoC) in my earlier post Inversion of Control – for easy integration. In this post I will show you how you can actually make your integration easy with implementation of a mini application sample based on IoC.

Objective
The main objective of this mini tutorial is to highlight the implementation of an interface based Inversion of Control (IoC) architecture and to state how it could help in the integration and maintenance of the application.

For this mini application I will use the following set of classes

  1. Dependency – This is the interface which is implementation as per my application versions progress and which will be used by the View components in my application. In other words this is my Model component in a MVC architecture
  2. Dependent – This is my View component which uses the Model component to produce the results for displaying. As the name suggests the class is dependent on the Dependency implementation.
  3. Injector – This is most important class in the application and which introduces the aspect of Inversion Of Control into the applications. This class can also be referred as the configurator class.
  4. Finally there can a number of implementations of the Dependency interface according to the needs of the application.

Note: This mini tutorial is based on the concept of Interface based IOC. It also assumes that you import the required classed in your Classes when compiling them.

Lets start with our tutorial. Read the rest of this entry »

Inversion of Control – for easy integration

You may have witnessed some of the J2EE frameworks provide a technique to get dynamically bound plain objects by making them bind to some features of the framework outside of the plain objects. This technique is called as the IoC or Inversion of Control. If we have to know about the meaning of this term let us emphasize on what inversion depicts in aspect of implementing some features in plain objects.

Overview
Suppose I have some functionality of my J2EE application in my model which is nothing but a simple POJO. Now I want this POJO to be incorporated into a web tier which is an MVC (Model View Controller) Architecture. The last thing I would want to do is modify the source of the model, view or controller and put in some additional code which would do this integration. But suppose I choose a framework in such a way that I put what exactly is to be done by the POJO in the MVC architecture in a simple XML config file and then put the config file in the framework and the framework does the rest of the integration work. Read the rest of this entry »

SCDJWS – mission accomplished

The post has been moved here.

Edit: The author has moved to http://techtracer.com
All further posts will be published at the new location.

Software development versus Software Engineering

Here are some of my views on software development and engineering. The engineering aspect of software may have a lot to cover regarding the models of how to go about building software in the right manner but I am trying to point out my thoughts only the direction of producing good software for meeting business goals.

Software Development

Software development as the name sounds is developing software. Here the term “software” has more impact than development because it depends on the subject matter which you are using for the underlying concept. A customer might want software for maintaining his/her contacts. Sounds simple enough because yes; it’s just simple software. Any executable program or a piece of code written for some or the other purpose constitutes into software. Development of this piece of code requires programmers who have knowledge of the development environment and the language used for the same. Any person who knows a language and its constructs is eligible for making the software required because the main concentration is on getting the final outcome of the desired thing which is nothing other than, a software application. I would once again signify here that the software is just being developed by any bunch of programmers. And that’s why the major stress is on the software which is being developed and the outcome as desired. The outcome is of major concern to the ones who will be using it for some small purpose.

Software Engineering

The term software engineering is somewhat more provocative in the current scenario of information technology as all the business held by different sector more and more are now relying on the use of information technology to reap the maximum benefits of automated mechanisms for carrying out routine chores of functions which involved a lot of manual labor in the earlier times. The throughput and the maintenance of software are much lesser when it comes to cost of having an automated mechanism rather than hiring manual workforce for the same. Read the rest of this entry »

Implementing RPC literal style web service in BEA Weblogic 8.1

Implementing an RPC Literal web service can be a tricky business in BEA Weblogic 8.1. By default the web service which you implement is generated in a RPC Encoded style. In order to create a RPC web service you would probably have to undergo a 2 way procedure as I did in order to get your web service working in RPC Literal style.

First open your web service file (with the extension .jws) in the design mode and open the property editor panel. Click on the header of the web service and change the soap-style of the web service from document to literal. Now run the .jws file in the test browser of Workshop and go to the overview tab. Click on the “complete WSDL” to get the WSDL generated for the web service. You would notice that the binding of the SOAP messages is now in the RPC style. But still the messages are communicated in the encoded format and not in the literal format and encoded is not a WS-I Basic Profile 1.0 compliant.

In order to make your web service compliant to Basic Profile you would have to change the style from encoded to literal. But there isn’t any option for it in the property editor panel provided in Workshop. In order to get a work around solution for this save the WSDL from the test browser to your local drive. Open the saved WSDL in a text editor and change all the instances of “encoded” to “literal” manually. Now go back to Workshop and import this WSDL in your web service project. In the Property Editor for your web service in Workshop choose file and click the 3 dots (…). It would provide you a prompt for associcating a custom WSDL to your web service. In this put the relative path of the imported WSDL starting from your web service project folder alongwith the extension. (eg. wsdl / foo.wsdl).

This wont affect in any way your current logic implemented in the .jws file and when you now run the file in test browser and access your web service it will be communicating in the RPC literal style.

Frameworks and the Design Pattern

A design pattern is a way of doing things. It solves the trouble of reinventing the same old wheel and lets us know from the makers themselves as to how fid they do it. THe main thing about using a design pattern is saving of time in deciding a technique to go about designing the architecture of your application.

For example, the factory pattern which has been developed on the OOAD theory says that instead of returning a specific object return a generic object via a factory class which creates the object for you. After your receive the object you can typecast it to your desired object.

A Framework on the otherhand is made for reusablity. When an application goes into the coding phase people write routines to get things done. Now these routines are commonly used in most of the applications viz. fetching data from somewhere, making a remoting call, or parsing an XML file. Such routines when clubbed together and released as a library or an api form a framework. This helps developers worlwide to use the framework and code for the application. Using a framework helps these developers to concentrate more on the business logic enhancement rather than studying how to fetch data from somewhere.

For example, the DWR, DOJO or GWT framework helps AJAX developers from writing the boring routines of handling the remoting concepts in javascript with the use of XMLHttpRequest object and alsogive the facility of dynamic code generation of required remoting routines.

Somwhere on the net I found a short and sweet differentiation

Dessign Pattern is thinking,
Framework is half product.