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.