Thursday, October 14, 2010

Accessing Master page control values from child page

Accessing Master page control values from child page:

Today, I am discussing about very common requirement where we need to access value of Master page from Child page. We will consider a case where there is dropdownlist in Master page and on change of dropdownlist, we will use selected value of Dropdownlist in child page. Lets start by following below steps:

1. Create Master page and add dropdownlist on aspx page

<asp:DropDownList ID="ddlThemes" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlThemes_OnSelectedIndexChanged">
<asp:ListItem Text="Select Theme" Value="0" Selected="true"></asp:ListItem>
<asp:ListItem Text="Red" Value="Red"></asp:ListItem>
<asp:ListItem Text="Blue" Value="Blue"></asp:ListItem>
<asp:ListItem Text="Green" Value="Green"></asp:ListItem>
</asp:DropDownList>

2. We need to raise an event when dropdownlist is changed. For this create public event and raise event from dropdownlist selectedindex change event in masterpage.cs file

public event CommandEventHandler ThemeChanged;
protected void ddlThemes_OnSelectedIndexChanged(object sender, EventArgs e)
{
    if (ddlThemes.SelectedIndex != 0 && ThemeChanged != null)
        ThemeChanged(this, new CommandEventArgs(ddlThemes.SelectedItem.Text, ddlThemes.SelectedValue));
}

3. Now create child page referring to above master page created. Add below code in aspx file:

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/masterpage.master" CodeFile="ChildPage.aspx.cs" Inherits="ChildPage" %>
<%@ MasterType VirtualPath="~/MasterPages/masterpage.master" %>

4. Now write the code to handle the event (created in Master page) in child code behind page:
public partial class ChildPage : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        Master.ThemeChanged += new CommandEventHandler(ThemeChangedFromMasterPage);
    }
    private void ThemeChangedFromMasterPage(object sender, CommandEventArgs e)
    {
        string ThemeText = e.CommandName;
        string ThemeValue = e.CommandArgument.ToString();
        Response.Write(ThemeText + " " + ThemeValue);
    }
}

That's all. Above steps will also help you to understand concept of Events and Events Handlers in .Net.

Friday, October 8, 2010

Google Announcing Google TV: TV meets web. Web meets TV.

Google had launched its official website this week for Google TV (a new experience of enjoying TV and Web together). Check out all the features of Google TV here. Some of the features of Google TV are quite interesting i.e. multiple phones acting as remote control, voice search, watching and browsing simultaneously, recording of program and great home page for TV. I hope with introduction of Google TV, TV will no longer be 'idiot box' and will become an interactive way to do lot more things.

There are some questions arises with introduction of Google TV, i.e. Does Google TV will replace Personal Computers in near future? Will all websites owners do changes to make compatible with Google TV?

For the Software Professionals, Google TV is built on Android and comes with the Google Chrome web browser. If you are interested in learning more about how to optimize website for viewing on Google TV, please visit developer page.

Also, I think I need to wait for another year for Google TV to come in India. Hope Google will launch Google TV soon in India.
Also check out Official Google Blog Announcing Google TV.

Checkout Logitech Revue and other stuff to use with your existing TV:

1. Logitech Mini Controller for Logitech Revue and Google TV


2.Logitech Keyboard Controller for Logitech Revue and Google TV


3. Logitech Revue Companion Box with Google TV and Keyboard
 

Wednesday, October 6, 2010

Agile methodology and Scrum

Today, in majority of IT / Non IT organizations, management is following Agile Methodology for the execution of the projects. Earlier also we might have completed projects successfully following same methods as Agile suggests but we were not known about terms and all tools that supports Agile. Today, I like to share concept, benefits and tools that support Agile Methods.

Agile methodology: Agile methodology is an approach to project management, typically used in software development. It helps teams respond to the unpredictability of building software through incremental, iterative work cadences, known as sprints.

It is very effective where Client frequently changes his requirement. Since it has more iteration, you can assure a solution that meets client requirements. It involves more client interaction and testing effort.

Agile Methodology Characteristics:
  • More Iterations
  • Frequent Delivery
  • Test frequently
  • Less defects
  • Accepts change of requirement at any stage, even late in development.
  • Continuous attention to technical excellence and good design enhances agility.
There are various methods by which Agile methodology can be implemented:-
  1. Extreme Programming (XP)
  2. Scrum
  3. Crystal
  4. Adaptive Software Development (ASD)
  5. Feature Driven Development (FDD)
  6. Dynamic Systems Development Method(DSDM)
  7. Lean software development
  8. XBreed
Out of the above methods Scrum and Extreme Programming (XP) are mostly used. We will discuss Scrum here.

Scrum: Scrum is an agile framework for completing complex projects. Scrum originally was formalized for software development projects, but works well for any complex, innovative scope of work. The possibilities are endless. The Scrum framework is deceptively simple.

In Scrum, projects are divided into succinct work cadences, known as sprints, which are typically one week, two weeks, or three weeks in duration. At the end of each sprint, stakeholders and team members meet to assess the progress of a project and plan its next steps. This allows a project’s direction to be adjusted or reoriented based on completed work, not speculation or predictions.

The Roles of Scrum:

Scrum has three fundamental roles: Product Owner, Scrum Master, and Team members.

1. Product Owner: In Scrum, the Product Owner is responsible for communicating the vision of the product to the development team. He or she must also represent the customer's interests through requirements and prioritization. Because the Product Owner has the most authority of the three roles, it's also the role with the most responsibility. In other words, the Product Owner is the single individual who must face the music when a project goes awry. At the same time, Product Owners must be available to answer questions from the team.

2. Scrum Master: The ScrumMaster acts as a liaison between the Product Owner and the team. The ScrumMaster does not manage the team. Instead, he or she works to remove any impediments that are obstructing the team from achieving its sprint goals. In short, this role helps the team remain creative and productive, while making sure its successes are visible to the Product Owner. The ScrumMaster also works to advise the Product Owner about how to maximize ROI for the team.

3. Team Members: In the Scrum methodology, the team is responsible for completing work. Ideally, teams consist of seven cross-functional members, plus or minus two individuals. For software projects, a typical team includes a mix of software engineers, architects, programmers, analysts, QA experts, testers, and UI designers. Each sprint, the team is responsible for determining how it will accomplish the work to be completed. This grants teams a great deal of autonomy, but, similar to the Product Owner’s situation, that freedom is accompanied by a responsibility to meet the goals of the sprint.

The Scrum Framework:

A typical working model of Scrum is described as below:
  • A product owner creates a prioritized wish list called a product backlog.
  • During sprint planning, the team pulls a small chunk from the top of that wish-list, a sprint backlog, and decides how to implement those pieces.
  • The team has a certain amount of time, a sprint, to complete its work - usually two to four weeks - but meets each day to assess its progress (daily scrum).
  • Along the way, the ScrumMaster keeps the team focused on its goal.
  • At the end of the sprint, the work should be potentially shippable, as in ready to hand to a customer, put on a store shelf, or show to a stakeholder.
  • The sprint ends with a sprint review and retrospective.
  • As the next sprint begins, the team chooses another chunk of the product backlog and begins working again.
Below image shows the Scrum framework:


The cycle repeats until enough items in the product backlog have been completed, the budget is depleted, or a deadline arrives. Which of these milestones marks the end of the work is entirely specific to the project. No matter which impetus stops work, Scrum ensures that the most valuable work has been completed when the project ends.

Meetings: Meetings play an important role in Scrum. Following different types of meetings are held at different stages of Scrum.

1. Daily Scrum: Each day during the sprint, a project status meeting occurs. This is called a "daily scrum", or "the daily stand-up". This meeting has specific guidelines:
  • The meeting starts precisely on time.
  • The meeting is time-boxed to 15 minutes
  • The meeting should happen at the same location and same time every day
During the meeting, each team member answers three questions:
  • What have you done since yesterday?
  • What are you planning to do today?
  • Do you have any problems preventing you from accomplishing your goal? (It is the role of the ScrumMaster to facilitate resolution of these impediments. Typically this should occur outside the context of the Daily Scrum so that it may stay under 15 minutes.)
2. Sprint Planning Meeting: At the beginning of the sprint cycle (every 7–30 days), a "Sprint Planning Meeting" is held.
  • Select what work is to be done
  • Prepare the Sprint Backlog that details the time it will take to do that work, with the entire team
  • Identify and communicate how much of the work is likely to be done during the current sprint
  • Eight hour time limit. 1st four hours: Product Owner + Team: dialog for prioritizing the Product Backlog. 2nd four hours: Team only: hashing out a plan for the Sprint, resulting in the Sprint Backlog
At the end of a sprint cycle, two meetings are held: the "Sprint Review Meeting" and the "Sprint Retrospective"

3. Sprint Review Meeting:
  • Review the work that was completed and not completed
  • Present the completed work to the stakeholders ("the demo")
  • Incomplete work cannot be demonstrated
  • Four hour time limit
4. Sprint Retrospective:
  • All team members reflect on the past sprint
  • Make continuous process improvements
  • Two main questions are asked in the sprint retrospective: What went well during the sprint? What could be improved in the next sprint?
  • Three hour time limit
Benefits of Scrum:
  • First thing first: A well-functioning Scrum will deliver the highest business value features first and will avoid building features that will never be used by the customer. Since industry data shows that about half of the software features developed are never used, development can be completed in half the time by avoiding waste, or unnecessary work.
  • High Productivity & Quality: In most companies, development is slowed down by issues identified as impediments during the daily meetings or planning and review meetings. With Scrum, these impediments are prioritized and systematically removed, further increasing productivity and quality.
  • Ease Pressure @ Work: Scrum removes management pressure from teams. Teams are allowed to select their own work, and then self-organize through close communication and mutual agreement within the team on how best to accomplish the work. In a successful Scrum, this autonomy can significantly improve the quality of life for developers and enhance employee retention for managers.
We can say that simple rules of Scrum are: continual inspection, adaptation, self-organization, and emergence of innovation. 

This can produce an
- exciting product for the customer,
- develop high team spirit and satisfying work,
- generate high productivity and customer satisfaction, and
- achieve the market and financial goals of the company.
- a win-win situation for company and team members.

As a result, Scrum is being widely adopted worldwide in companies large and small, localized or distributed, open source or proprietary, for virtually any type or size of project.

Burn Down Chart:
Here, we will also discuss about Burn Down chart - a very common term in Agile Methodology. Burn Down Chart is for tracking day to day project/resources activities.

The Burn Down chart is a publicly displayed chart showing remaining work in the sprint backlog. Updated every day, it gives a simple view of the sprint progress. It also provides quick visualizations for reference.

It short, Burn Down Chart is a graphical representation of work left to do versus time. The outstanding work (or backlog) is often on the vertical axis, with time along the horizontal. That is, it is a run chart of outstanding work. It is useful for predicting when all of the work will be completed. Sample Burn Down chart is shown below:


With the help of Burn Down chart we can get clear idea of following attributes:

1. List of task to be done
2. Timeliness
3. Status
4. Remarks/comments
5. Actions to be taken against pending items in project
6. Extra time spent on lunch, tea, etc

Hope above information will helpful to start your new project with Agile Methodology.

Some of the Agile software Project management Open Source Tools:
http://www.icescrum.org/
http://www.agile42.com/cms/pages/
http://www.agile-tools.net/