Saturday, April 11, 2009

Real mistake - Starting with Outsourcing Project Management II...

Guys,

I promise this would be my last post on Outsourcing Project Management. Here are the reasons why offshore developers should not manage your projects.


1. It is your project! It is your money! You have the final say about what the project is. Giving that job to the programmer is like letting the lion guard the stable (no, I'm not saying that programmers are lion and they will eat all the animals in your stable, many just need to be properly managed). Trust me I have seen people learn this the hard way.



2. Programmer do not know the thorough details of your business, your users, etc. You have to provide direction, programmers create software from that direction.



3. An old expression says you only have the right to expect what you inspect. You have to be involved in the project to make sure it delivers what you need. (from quoteland.com)


I think I have scared you enough about Offshore Custom Application Development. Some of you probably not do it but it is cheap, it is profitable and it is tough. Always remember If it was easy, everybody would be doing it.

ASP.NET 2.0: Creating Portal like applications using Membershi...

This post is for people who are pretty familiar with ASP.NET 2.0 Membership Api. I am going to talk briefly about Membership API and then move towards portal kind of application.



Membership API has username and application name as a composite primary key. This is provider-based approach so it typically consists of Application Name attribute in all possible cases. For most of the web applications, during development mode machine.config sets "/" or "/webfoldername" depending on which web server you are using . The one restriciton on the applicationName attribute though is that it is statically defined. Once you set the value in configuration, the provider remembers that value for the rest of its lifetime. Here is the fun part, if you take a look at the Membership Provider base class, applicationname property is abstract and a setter is also defined. Yes, I agree you don't normally see that. But the beauty is, it gives us power to change the applicationname at runtime. But it is not as simple as we thought to get it working as a portal application. Here are the following steps that will help you achieve portal like behavior. I have converted dozens of application using this approach. Its proven and it works.





Step #1



* Create a class name PortalHttpModule that implements IHttpModule in App_Code folder. Here is the content

of that class.



using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;





public class PortalHttpModule :IHttpModule // thanks Kieran for pointing this out

{

public void Dispose()

{ return; }

private void DetermineApplicationName(Object sender, EventArgs e)

{

HttpApplication app = (HttpApplication)sender;

HttpContext context = app.Context;

string qAppName = app.Request.QueryString["appname"];

if (!String.IsNullOrEmpty(qAppName))

context.Items["ApplicationName"] = qAppName;

else

context.Items["ApplicationName"] = "NA";

}

public void Init(HttpApplication app)

{

app.BeginRequest +=

new EventHandler(this.DetermineApplicationName);

}

}





* The next step is to write a custom provider that overrides the applicationName property getter. This will also be placed in App_Code



using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;



public class ApplicationProvider : SqlMembershipProvider

{

public override string ApplicationName

{

get

{

string appNameFromContext =

(string)HttpContext.Current.Items["ApplicationName"];

if (appNameFromContext != "NA")

return appNameFromContext;

else

return base.ApplicationName;

}

}

}



* Last but not least. We have to add couple lines of code in web config. Here it is
















connectionStringName=”LocalSqlServer” />







* Create a page called create user. Drag & Drop Create user wizard control. Save it



* Open your browser and request following URL

http://localhost/yourappname/createuser.aspx?appname=alyb-rocks

or

http://localhost/yourappname/createuser.aspx?appname=tookoolforschool

* Try creating user through wizard control and take a look at db. You will see different applicationID




I currently use this applicationname as my subdomain using wildcard subdomain. It is very easy to set up. Most domain registrars give you wildcard domain which means that all your subdomain will point to one web application in that case you can replace

string qAppName = app.Request.QueryString["appname"];

with

string qAppName = app.Context.Request.ServerVariables["Host"].Substring(0, app.Context.Request.ServerVariables["Host"].IndexOf("."));



Enjoy!

Code, Build, Test, Deploy Part II... Outsourcing Development

When testing plan comes to mind, you need something to track it. There are some free tools out there like IssuesTracker, BugTracker etc. I have personally used bugtracker. It is very intuitive. Keep notes as you test so you will be able to refer to them when a problem occurs. The most important thing to tell the developer is what you did right before you saw a bug. This is very important in helping the programmer locate and correct issues. Keeping a log makes it really easy to track progress.

Bottom line is that test early, and often. Test everything on every build. Do some monkey testing. And always keep a log of your testing.

Why Companies Ignore Offshore/Onshore Outsourcing

I have talked to professionals from a lot of companies about why they ignore Outsourcing. After talking to some of the Offshore consulting experts I came up with the following lists.


* You don't know how to get started. That includes selection of team.

* You think it only makes sense when there are big projects. Small projects doesn't make that much difference

* You think that all software must be built inhouse to get the best return/result.

* You dont account the time to hire a development team of 2-3 programmers. Getting everyone on same page.

Why Onshore QA is a must

After working with offshore team, I found it impossible to get a good quality product without presence of a QA guy. QA is a critical part of development process. It is definately needed when team is located offshore. Here are some mistakes that companies make.


1. No Bug Tracking.

2. No Criteria defined for release of software. Your client/audience is completely oblivious of what product will look like.

3. You dont start testing earlier in the phase.

4. You dont do stress testing or load testing.

5. You think unit testing is enough.

6. You wait till beta to start testing.

7. You dont test different testing environment like OS & Browser variations.


Thats all for now. I will try to focus on how to get started with offshore including sample document/specs that you can send to offshore team.

Brief Introduction to XAML (Zammel)

Microsoft, the evil empire that we all love, recently release Vista for everyone. My recent trip to Dallas made me learn about all this new stuff microsoft has been cooking for an year or two. I will try to share what I recently learnt. One of the great things about Vista is that it will support applicaitons that employ graphics used by computer games. I was a big fan of Wolf 3D game. Using WPF(Windows Presentation Foundation), you can create graphics like that by just typing xml. Many feel that XAML will eliminate the need for multiple file formats or plug-ins (read: Flash), while lowering development costs and reducing time to market.

I just made a contact management program in XAML. And I have to admit that it is not that different. Any developer can learn it. And people with ASP.NET experience will have pick this up pretty quickly. Here is how a sample of XAML code.


The same Button object created using C# requires four lines:

Button myBtn = new Button( );
myBtn.Background = Brushes.Green;
myBtn.Text="Submit";
myBtn.Click += new System.EventHandler(OnClickHandler);


This looks pretty familiar right? I would recomment you guys to get started on XAML. Thats the next generation for application. It may seems like browser apps may not last forever. I will soon post my content management application using XAML.

Application Design Architectures

I recently went through a challenge that made me brush up my knowledge on design patterns. It was back in the days when I learnt about different kinds of application design patterns. It was during the sophomore year.

I would like to talk briefly about design patterns. Although these may sound like overhead for some of you who believe in rapid application development but to be honest, these are used in renowned development application.

Today, I will like to briefly portray two of the most common design architectures. They are listed as follows:

1. Two-Tier Design

A two tier design is an architecture that comprises of two elements. One is business/application logic and other is database. This is very suitable for web or windows application. A two tier application can be built very rapidly that features low overhead and high performance. It can be very cost effective. However, it may be require some efforts to make it scalable. It may require high maintenance as well. The main reason why this has some of these deficiencies is because it is very tightly coupled with UI and data object so even a minor application touches every single layer.

2. Three-Tier Design

A three tier design is an architecture that comprises of three elements. UI, Business Logic and Database. Three tier application design is popular where it requires high performance with medium to long life expectancy. It is very effective for post-development integration as well as scalability and stability. These elements are not tightly coupled as they are in 2 tier architecture.