Sunday, August 2, 2009

Struts – Ten Step Development Plan

Ten Step Development Plan

Before we proceed to start actual Project Development Plan, let's ask following question to yourself and decide whether struts apply to your project?

Identify the applicability to use Struts

  • Does this project have many screens?
  • Are there lots of interactions required by user?
  • Is it important to have flexible configuration?
  • Does this application fit into MVC architecture?
  • Are the roles and responsibility of the team clearly defined?

Ten-step Development Program

  • Gather and Define project requirement: Logical and most basic step in any application development plan. For example:
  • A login system
  • Add/Modify/Delete
  • Search facility
  • Display data in tabular or non-tabular format
  • Session Management

  • Define and Develop each screen requirement: After defining our requirement, we will define screen (UI) applicable for our project, example:
  • Screen

    Data fields

    Type

    Comments

    Logon

    User name

    String

    textbox

    Password

    String

    password

    Add/modify/delete

    Form, Table

    Editable

    Search

    Filters

    Drop down, text box

    Display

    Table, Div, XML

    View only

  • Determine all the access paths for each screen: Define how each screen will be access; it will define a logic flow for an application.

  • Define the ActionMappings: To define what happens when the screen actually accessed. It's like a roadmap for Actions, which roadways should be taken define by ActionMappings. It is necessary to define what happens upon success, failure or any other process that's needs to be initiated from the resulting Action class.
  • Create the ActionForms: The form class is correspondence to the data fields on a screen. All form classes in struts extend org.apache.struts.action.ActionForm or org.apache.sturts.action.DynaActionForm. The ActionForm is used to transfer data from a JSP and make it available in an object form that should correlate the data fields that we create in step 2 (Screen Requirement). The form class is also used for validation of form fields. An ActionForm class handles all the form variables (Setter/Getter methods) and has the necessary validation.
  • Develop Actions: An action will take place for every situation or activity possible in an application. The ActionMappings should tell us what action needs to perform, as they are like the roadmap and tell us how we get from point A to point B. For example:
  • Logon Action: Once the user logs on, it will check for authentication. If it succeed then the activity returns success else it returns failure.
  • Insert Action: Take the inputs/data from form/JSP and insert in database. If the insert is successful, we will display a message else a failure will returns.
  • Search Action: Returns the records that match criteria. If it succeeds, the DisplayAllAction will call to display the records returned in the record set.
  • DisplayAllAction: Displays the current record set.
  • LogOffAction: Log off user from current session.

  • Develop the Application Business Logic: Application Business Logics are the core of any business application. Typically, they are written as JavaBeans or Enterprise JavaBeans. They are called from the appropriate Action class.
  • Create JSPs: We look back at our workflow and see what success, failure or forward pages are necessary. It can easily itemize by at ActionMapping. Most of the forwards are probably JSP files, but it's not uncommon for actions to forward to another Action class.
  • Build the appropriate configuration files: The web.xml is used by the Servlet container to determine the configuration of the various Servlets supported on that server. The struts-config.xml file is used by the controller Servlet (as defined in the web.xml) to declare ActionForms, ActionMappings and ActionClasses.
  • Build, Test, Deploy: It can be treated as three different steps but here we will consider them together as a single step.


Disclaimer: The above steps are the extract from Morgan Kaufmann – The Struts Framework book, please refers to the book for detailed study.

Thursday, April 9, 2009

Sadho Re by Agnee

I would like to share a very beautiful song written by Sant Kabir and composed by Indian Rock Band Agnee, copyright Sony BMG but before that a small incident for you....

Sometimes you wish to recall something but somehow you don’t have any clue to recall it.

It’s mostly happen with me; one of such incident has occurred few days back...

there is a song, I heard last year, a very beautiful song indeed, I wish to add it in my orkut video list however I forgot its lyrics, its singer etc. the only thing remembered to me was its video and music.

But with video and music you cannot search in youtube (if yes may be some other way, I am not aware :-)).

For two days I tried my best to search or recall it, unfortunately I failed finally I asked to the same old colleague who has shown me that video and hurray :) I got the song...

It’s a very nice song, it depict the real truth of our society. I wonder how Sant Kabir’s these doha’s still so relevant with our society and composition by Agnee is perfectly blend with it.

Here I present you with lyrics of the song with Amit's extra touch... ;-), hope you like it.

Wednesday, December 31, 2008

Happy New Year - 2009
























"Happy New Year 2009"

Welcome 2009, may the year will bring all the happiness and success to every one's life...

A very happy new year to all of you...

Thursday, December 25, 2008

An example of “Humanity “

Here I would like to share a small story which occurred in a couple of weeks ago…

It was a normal winter sunny day, and at around 11 AM, we (me and my colleagues) went outside to have a cup of tea. At the tea stall, I saw one of my colleague was asking for water to remove blood strain from his hand and another one was carrying a first aid box, in a inquisitiveness we enquired about the affair, the story which he told me was something which might not interest most of you but I think it’s something which needs to be shared, so let’s move to this small story.

Outside of my office’s corridor there is an open ground where there is a tea stall, few slums and few stray animals.

We all are aware how most of us behave with stray animals however I don’t like to make any comments on it and continue with the story.

There are few donkeys that have been tied with rope between their two legs and it is very difficult for them to move, still nobody seems to care. One of the donkeys was bleeding from past few days; the rope has made a wound in its back leg. So, those two colleagues of mine decide to help him out. They bring the first aid box from office’s reception and forcibly laid down the donkey to ground with the help of few nearby college students. One of them cut the rope, it was interleave between the wound and was not easy to remove however he did it and done the first aid.

We are not aware where that donkey is? But what they did was something which must be applauded.

Like to name those two colleagues of mine, Vikram and Steven, guys you have done wonderful work and made an example for humanity.

Friday, November 28, 2008

I hate the word "Again"


I hate the word again..
Every time I hear terror strikes again.
Failure of our intelligence again.
Politics over terrorism again.
False dreams and fake promises made by our politicians again.
Hundreds of innocent people died again.
Enough is enough. Is there anyone who can assure 26/11, 13/09 and many more such dates will not repeat again.

"Hats off to our Army Jawaan, NSG and Navy commandos and police officials for their courage and sacrifice" Jai Hind.

Tuesday, November 18, 2008

13th September 2008 (My Experience)

It was a normal Saturday; my office colleague has planned for a get together in CP at around 4 PM.

I was planning to go late as I had some work to do. Anurag and Sukant (My friends and colleague) have asked me to let them know whenever I left home for CP. Around 4:30 PM, I left for dwarka metro station, I called Anurag; he was already in metro and was heading towards CP in few minutes.

At around 6 PM, I was in CP; I made a call Anurag to know where they are? He directed me the way to reach TGI Friday, at around 6:10 PM I joined them, 6 of my colleagues were already there and 4 more are on their way. We are looking for a place other than TGI Friday where all of us can accommodate, however as it was a Saturday evening so finding a place in CP is a very big task so we decided to be there only and asked the manager if she could help us with one more table, few minutes later everything was done and we are ready for our night out. After approx 20 minutes, those other people also reached CP, Anurag told them the place, he went outside to guide them, suddenly I heard a shrill sound, we are inside, music is loud, glasses are sound proof still the sound was stentorian, the moment I heard it I was shocked and stunned, I asked myself it should not be a bomb blast may be some marriage cracker and all. Suddenly Anurag came inside, Oh God it was really a bomb blast, he told us that there are two blasts in CP, he called the people outside, and they were fine. We are advised not to go outside as these days blast ensues in series. We started to make call at our home before the network gets jammed. I made a call to my father and informed him about the incident, nobody was aware that something like this has happened in Delhi. Summit, Parthi and Ashish (People who joined us later) were coming via central park, it was a lucky escape for them, they were heading towards the blast point suddenly they received Anurag’s call, Summit located the point and instead of coming from gate, jumped from the fences, Parthi and Ashish followed him, the moment they crossed the fence the blast ensued. They escaped it by only 100 meters. I was still in shock and it was showing on my face. Anurag, Summit everyone was trying to cheer me up but it was not fear it was aggravation, anger which was coming outside. 5 blasts in Delhi I want to ask God and those people why? What they get by killing innocent people?

I called my home once again, my mother picked it up, and I told her what has happened? She wants me to reach home as soon as possible but I told mom that it’s better to be there for 1 and 2 hours.

Geetika, Meenakshi and few more friends called me as they were aware that I am in CP.

Few minutes later we went outside, the Ambulance, Police, Fire brigade, Media everyone was there, few minutes earlier where there is joy, love, happiness now it has changed to blood, bodies and terror.

Few foreigner were there, I saw face of one of them, fear was visible and why not? He was thousands of kilometers away from home, if my family is concerned about me in few kilometers what could be his story?

At around 8 PM we took metro from CP, you hardly see any panic among people, how normal these things has became in everybody’s life? It’s only a topic of discussion. We are proud that even after such incidents life keeps going, we are not afraid of anything but I asked myself is it right? Is showing braveness and forgetting everything is the answer of every question?

I was complaining about our security, what police is doing and what government is doing?

We reached last station of metro, I heard one announcement “Please check your seat’s underneath, any un identifying article, radio, bag anything could be a bomb, please inform security”.

Did anyone one of us has ever checked things around us, do we take any step for our or others security?

Answer is No. and this is the reason why these people succeed in their plans.

We are billions of people, it is very difficult for police to be everywhere but if we take few small steps for our security believe me we are billions of police on road.

In the end I pray peace for every victim’s soul and their relatives. And I wish no one will ever experience such things in LIFE.