Friday, December 30, 2005

Spring is HOT - An Introduction

This time I come up with an interesting framework and it's popularity is increasing in the Java development community. The so called framework is Spring. I insisted to learn spring becuase many of the requirements i have seen in the companies mention Spring framework. So, i decided to learn Spring.

I have decided to write series of blogs on spring. In this "Spring is HOT - An Introduction" , i will give an introduction to the spring frmework. Future blogs i will explain how to use Spring in the web developement. In this blog i am not going to teach you how to program in spring rather i will explain you what is spring and how it is richer than EJB.

If you think Spring is an framework in the place of Struts, you have wrong conception about the Spring . Spring is not only a framework, also it is an container to develope high end enterprise applications. Unlike EJB, it doesn't come up with more complex architecture rather it is a simple framewok to use in our application with all other services(Transaction,Security,etc.) wrapped up your code. All the services are bundled in the different jar files and you just add the required files into your project.

Spring uses Plain Old Java Object(POJO) paradigm to implement the services needed for your application. This facilitate the use of Spring framework out of the container. Easy to Unit Test the Spring enabled applications. Another salient feature of Spring is, it allows us to easily integrate with other frameworks like Struts, WebWorks, Hibernate, etc.

Spring is built using two programming techniques : Inversion of Control(IoC) and Aspect Oriented Programming(AOP). In my next blog i will write about IoC in detail. Spring is extensively implemented in the Banking solutions. I can see the prosperous year ahead for Spring in 2006.

Spring HomePage

Spring Downloads

Thursday, December 29, 2005

List of Web frameworks in Java

We have lot of opensource frameworks available for Java developement. If we are closely looking at the each one, they have specific feature to highlight from the other frameworks. In this blog i just write the list of frameworks available and give the brief on it. I am not going to write about all the frameworks in the market. I will look into few, which is more familiar with us. Also i may miss some frameworks. I will write those frameworks in my future blogs.

Struts

Struts is the best implementation for Model View Controller(MVC) pattern and widely accepted by the developers. This framework is originated by the Apache Foundation, a famous open source commuinty in Java. Recent days the Struts framework lossing its popularity to other frameworks in the market Java Server Faces(JSF),Spring,etc. But still its mostly used in all the web applications. Currently this project developement is stopped and started a sub project called Shale. Which is more like Java Server Faces(JSF).

Spring

Spring is a lightweight container and framework to develope and deploy the enterprise application. It is an alternative for Enterprise Java Beans(EJB). It reduce the complexity behind developing EJB's, and it uses only Plain Old Java Objects(POJOs) as the componenets. It uses two types of programming techniques : Inversion of control (also called as Dependency Injection) and Aspect Oriented Programming(AOP).

This framework become more popular amoung the J2EE developers becuse of its simplicity and its more flexible to add the persistance layer which ever you want for your application(ie,Hibernate, DAO,etc). Unlike EJBs it need not force you to add all the service to the container, you have the control of adding services to your application. The main pitfall of EJB is for an simple EJB also you have to bare the cost of container servies. But in spring this overhead is reduced. Every service has been modulrized and you have the option to add into your application. For your convenience, spring framework gives all the services in the different jar files. You can download it from here.

Also Spring gives you the MVC pattern to build your web application. This feature makes spring stand out from the other frameworks. Spring contains both container and framework. It gives the better way to integrate with EJBs and Struts framework. Those who feel EJB is more complicated, Spring will be the answer.

This framework is developer by Interface21 and home page is SpringFramework.


Java Server Faces(JSF)

Java Server Faces(JSF) is a java based web framework to develope web applications. Its is used inside an Java Server Pages(JSP) and gives more flexibility to design User Interfaces. This framework is designed and maintained by Sun Micro Systems. Craig McClanahan is the co-specification lead for this framework. Also he is the creator of Struts framework. You can read his blog to find more information about him. From his blog:

"It should come as no surprise that the most frequent questions I get asked center around the issue of which of these two web tier technologies an organization or individual developer should consider using. It makes sense to ask me, because I was the original creator of the Struts Framework, and was the co-specification lead for JavaServer Faces 1.0 (JSF).

Usually, the question is framed as an or issue, based on an understanding that the two technologies are mutually exclusive. That turns out not to be the case, but it can still be difficult to determine what to do. This blog entry provides my current advice on the subject -- but, to understand it better, it's worth briefly reviewing the development and focus of the two technologies.

The story is a little long compared to typical blog entries; if you want to cut to the chase and see my advice, scroll down to the section entitled The Bottom Line, below."


Web Work

WebWork is a Java web-application development framework. It is built specifically with developer productivity and code simplicity in mind. WebWork is built on top of XWork, which provides a generic command pattern framework as well as an Inversion of Control container. In addition to these features, WebWork provides robust support for building reusable UI templates, such as form controls, UI themes, internationalization, dynamic form parameter mapping to JavaBeans, robust client and server side validation, and much more.

WebWork's homepage is http://www.opensymphony.com/webwork.

Tapestry


Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server.

Tapestry divides a web application into a set of pages, each constructed from components. This provides a consistent structure, allowing the Tapestry framework to assume responsibility for key concerns such as URL construction and dispatch, persistent state storage on the client or on the server, user input validation, localization/internationalization, and exception reporting. Developing Tapestry applications involves creating HTML templates using plain HTML, and combining the templates with small amounts of Java code using (optional) XML descriptor files. In Tapestry, you create your application in terms of objects, and the methods and properties of those objects -- and specifically not in terms of URLs and query parameters. Tapestry brings true object oriented development to Java web applications.

This framework is developed by Apache foundation. You can access the documentation at the following URL Tapestry .

Tuesday, December 27, 2005

The Java SE 6 (Mustang) Holiday Quiz

Those who are still reading about Tiger(Java 5.0), this could make a little surprise. Sun has decided to release it's next version of Java by 2006. The new version Java 6.0 is code named as "Mustang". Also they made a small quiz on this new version and published in their site. If you are the person watching the activities of Mustang project, this quiz would be more interesting.Mustang is targeted for final release in summer of 2006.

Here is the link to take up the quiz:

Mustang Quiz

Monday, December 26, 2005

AJAX - a puzzword from Web 2.0

Hello Friends,

I am here to talk about a new puzzword from internet, its called AJAX. AJAX stands for Asychronous Javascript and XML.I did few samples on AJAX to know how it works. Realy its amazing, the way its reloading the part of a page. I can say it will make a major change in the web development. To develope interent applications, AJAX gives the rich user interfaces and fast loading of pages.

Before writing about AJAX, i want to spell out few words on Web 2.0. When you talk about AJAX, you also have the reason to hear the term Web 2.0. The internet experts says that, we are in the second phase of internet era, so called Web 2.0. The first phase of the internet era is headed by Netscape and its outplayed by Microsoft with its InternetExplorer(IE). But this time Google tossed the coin in right side to take the control of internet users from Microsoft and Yahoo.

Lets move into the AJAX, its founded by Microsoft in the late nineties(1998) and they call it as ActiveX objects. Introduced in the Internet Explorer 5.0. Later this object is included in the modern web browsers Mozila,FireFox,Opera,etc. As it become more popular amoung web developers, Mr. Jesse James Garrett from www.adaptivepath.com is named it as AJAX. He is also called as the Father of AJAX.

The truth is AJAX is not an technology or framework. Its is all about a simple XMLHttpRequest object which is used for communicating to the server asychronously. Moreover, we can say it as Socket for communicating to the server. Learning AJAX is quite easy compare to other technologies. AJAX is combination of technologies : XML,Document Object Model(DOM),JavaScript,HTML,XHTML,DHTML.

Cool links to learn AJAX :
http://www.ajaxgoals.com/forums/
http://www.ajaxgoals.com/
http://ajaxtags.no-ip.info/
http://www-128.ibm.com/developerworks/library/j-ajax1/?ca=dgr-lnxw01Ajax
http://en.wikipedia.org/wiki/AJAX
http://developer.apple.com/internet/webcontent/xmlhttpreq.html

Saturday, October 01, 2005

SCJP 5.0 book is released

HI All,
After a long awaiting, SCJP 5.0 book is releassed.
For more details, follow the link :
SCJP 5.0 book by Kathy Siera, BertBates

Saturday, September 24, 2005

Speeding Up Firefox

Speeding Up Firefox
How to make Firefox load faster

The whole point of this is to speed up Firefox, and for me, it worked great. Normally when you first install Firefox, the loading time is slow, even for broadband. Remember, this is a hack for those broadband users. Sorry 56k'ers, you'll have to sit this one out. Another great thing about this is that it takes only a few minutes to tweak your browser.
Tweaking the Browser

Step One: Altering
Open Firefox and type "about:config" into the address bar. Now, scroll down and search for the following entry: network.http.pipelining. Now, set the value to "true". Next, search for network.http.proxy.pipelining and also set that to true. Then find network.http.pipelining.maxrequests and set the value to whatever you want. The number you enter means the number of requests it will take at one time. Personally, 30 is what I use.

Step Two: Creating
Still in the about:config file, right-click. Now select New, and from New, select Integer. Name the new integer to nglayout.initialpaint.delay and put the value to "0". This value is the time that Firefox waits before it acts apon the information it recieves.

Now, your browser should load much faster! Enjoy using Firefox and your broadband to it's full potential.
How It Works

The altering and creating you did in the hack is very simple and is self-explanatory. The first three values you edited(network.http.pipelining, network.http.proxy.pipelining, and network.http.pipelining.maxrequests) have to deal with the requests would make at a time. When you enable pipelining, it allows Firefox to make more requests at once. Thus, speeding up page loading.

Then, the second step(nglayout.initialpaint.delay). As I hinted earlier, this value is the time that Firefox waits before it acts apon the information it recieves. By setting the value to "0", it makes firefox wait "0"(milliseconds probably) before it starts acting on the information it just recived. In other terms, no waiting time.

Thursday, September 15, 2005

Google Hack to find Meaning of a word

We can use Google search engine to perform different tasks, not only for searching queries.One of the cool hack is to find the synonym and relatives of a given word or a phrase.




Use the "define" command to find the synonym for a word.

Example:
define:enormous

Saturday, August 27, 2005

What's New in EJB 3.0

Whats is new in EnterpriseJavaBeans(EJB) 3.0?. This is the question floating around the EJB developer's mind for a quite long time. Hi Folks, put an end to your look around. Here you will get what you are looking for.
I came up with an interesting article, it talks on the various features included in the Sun's EJB 3.0 specification. I written-up this for java.net site. I covered most of the prominent features in EJB 3.0 (eg.,) Usage of annoatations, Interceptors, Injection, etc. But, I wrote little about the Entity Beans, which is a part of Persistence API's specification.
Specifications are organized in three categories:
i)EJB 3.0 Simplified API
ii)EJB Core Contracts and Requirements
iii)Persistence API
Read the article:
What's New in EJB 3.0

Sunday, July 31, 2005

Boxing Conversiona in J2SE 5.0

HI,

Lot of new features in Java 5.0. Autoboxing is one amoung them. It makes casting of wrapper objets is much easier then previous versions.

read the article about autoboxing in java.net
Boxing Conversions in Java 5.0

Regards,
Krishna.S.