Saturday, September 27, 2008

Implementing a Database Factory Pattern in C# ASP .NET

Introduction

Designing a C# ASP .NET web application which utilizes a database is a common and straight-forward task for developers. The web application accesses various tables, stored procedures, executes SQL script, and retrieves records. Often, developers not familiar with design patterns will use a simple design for making database calls, which relies on calling database functions straight from the user interface. While this certainly works (and provided you close and dispose of all connections when you're done with them), you achieve a far greater amount of flexibility with your C# ASP .NET web application be using a well-defined and loosely-coupled database layer.

Why Do I Need a Database Layer Anyway?

When creating software for clients, even the beginner developer recognizes the frequency of change. Requirements change, user interface pieces change, platforms change, and databases changes. Determining ways to minimize re-work in your web applications becomes a very important task and by adding a distinct database layer to your C# ASP .NET application, you can greatly increase its flexibility and adaptability to change.

In addition to adaptability, a database layer can also provide an on-the-fly means of changing connections strings and even the database type itself. By changing just a few lines in your C# ASP .NET web.config file, you can effectively change the type of database accessed by your application from MSSQL to Oracle to MySQL - all without a single change to the application code.

The Simple Method

Many developers begin by coding the user interface of a web application, as this helps move the project visually. Because of this, it's not surprising that database code for populating the fields is often mixed directly in. In a C# ASP .NET application, this is similar to adding calls to SQLConnection in your Page_Load() function, as shown below.

using System.Data.SqlClient;

protected void Page_Load(object sender, EventArgs e)
{
using (SqlConnection MyConnection = new SqlConnection(MyConnectionString))
{
using (SqlCommand MyCommand = new SqlCommand("SELECT * FROM Flowers", MyConnection))
{
using (SqlDataReader MyReader = MyCommand.ExecuteReader())
{
// read flowers and process ...
}
}
}

}

Notice in the above code, we're referencing System.Data.SqlClient directly in the user interface code. We're also making calls to the database. A program will run just fine with this method. However, managing this code becomes a problem.

The core problem with the above code is not only that business logic may be mixed in with the user interface code (business logic would appear inside the "read database information" section), but that including database accessibility logic complicates the readability of the program. Furthermore, what happens when you need to change from using the SqlClient to using ODBC? You could change the "using" statement and rename the lines from SqlConnection to OdbcConnection throughout your code, but this may waste time and is also prone to errors.

A much more clear picture of this application could be made by leaving only user interface code inside the Page_Load() function. Defer the decision on what type of database to use and instead concentrate on user interface code. Any calls to database routines would be handled by a call to a separate layer, as follows:

using MyStuff.Managers;

protected void Page_Load(object sender, EventArgs e)
{
Flowers = CommonManager.GetFlowers();
}

Notice in the above code, the database functionality has been minimized to just a single line. The details of the database logic are abstracted away in a database layer. This greatly simplifies reading and managing the code. Now that you can see the initial benefits to utilizing a database layer in your C# ASP .NET web application, let's move on to implementing it.

Putting the Web.Config to Good Use

Before defining the actual database factory classes, we can use the C# ASP .NET web application's web.config file to hold some important data about how our database factory will be used. We will be storing information such as the type of database provider (MSSQL, Oracle, MySQL), a list of possible connection strings, as well as which connection string to use. By storing this information in the web.config file, we provide the flexibility to change the database provider or connection string in real-time, without changing code in the application.

Our web.config file will look similar to the following:








In the above web.config file, we have two connection strings defined. One is for an Oracle database and another for an MSSQL database. You could have any number of connection strings. Our database factory design uses its own web.config section, defined in DatabaseFactoryConfiguration. This allows us to tell the database factory which provider class to instantiate (Oracle, MSSQL, etc) and which connection string to use. You can see the flexibility this adds, by allowing us to change any of these parts right in the web.config file.

The DatabaseFactory Web.Config Handler

Since we've added our own custom section to the web.config file for the database factory, we need to create a web.config custom section handler. The section handler is defined as follows:

using System.Configuration;

public sealed class DatabaseFactorySectionHandler : ConfigurationSection
{
[ConfigurationProperty("Name")]
public string Name
{
get { return (string)base["Name"]; }
}

[ConfigurationProperty("ConnectionStringName")]
public string ConnectionStringName
{
get { return (string)base["ConnectionStringName"]; }
}

public string ConnectionString
{
get
{
try
{
return ConfigurationManager.ConnectionStrings[ConnectionStringName].ConnectionString;
}
catch (Exception excep)
{
throw new Exception("Connection string " + ConnectionStringName + " was not found in web.config. " + excep.Message);
}
}
}
}

The only important part to note about the section handler is that it derives from the ConfigurationSection base class. When this class is instantiated, it will automatically read the line from the web.config file and populate with the values. Since we include a ConnectionString property, it will also fetch the correct connection string, so that we never have to access the ConfigurationManager.ConnectionStrings property ourselves.

It All Starts With a Database

The first part to creating a database factory design pattern is to implement your generic Database object. This is the object you will reference when calling database routines. Since this object is generic, you don't have to decide what type of physical database to actually use with it. This gives you the power to change database providers without changing any of your code. The database object is designed as follows:

using System.Data;

public abstract class Database
{
public string connectionString;

#region Abstract Functions

public abstract IDbConnection CreateConnection();
public abstract IDbCommand CreateCommand();
public abstract IDbConnection CreateOpenConnection();
public abstract IDbCommand CreateCommand(string commandText, IDbConnection connection);
public abstract IDbCommand CreateStoredProcCommand(string procName, IDbConnection connection);
public abstract IDataParameter CreateParameter(string parameterName, object parameterValue);

#endregion
}

It's important to note that we're using .NET's own abstract database factory interfaces. The interfaces can be used in exactly the same way as the concrete database classes (SqlConnection, OdbcCommand, etc), without forcing you to bind to one. This is the core piece to providing flexibility to your database layer.

The Powerful Database Factory

With the details out of the way, we can move on to the power behind the database factory design pattern, which of course, is the factory class itself. The database factory is the class we will use to instantiate the concrete provider for our generic Database class. Remember, we defined an abstract Database class which we can use without deciding on a concrete database provider. Instead, we specify the concrete provider in the web.config and let the database factory design pattern instantiate it. Note, the database factory is able to instantiate any type of concrete database by using C# .NET reflection.

The database factory is defined as follows:

using System.Reflection;
using System.Configuration;

public sealed class DatabaseFactory
{
public static DatabaseFactorySectionHandler sectionHandler = (DatabaseFactorySectionHandler)ConfigurationManager.GetSection("DatabaseFactoryConfiguration");

private DatabaseFactory() { }

public static Database CreateDatabase()
{
// Verify a DatabaseFactoryConfiguration line exists in the web.config.
if (sectionHandler.Name.Length == 0)
{
throw new Exception("Database name not defined in DatabaseFactoryConfiguration section of web.config.");
}

try
{
// Find the class
Type database = Type.GetType(sectionHandler.Name);

// Get it's constructor
ConstructorInfo constructor = database.GetConstructor(new Type[] { });

// Invoke it's constructor, which returns an instance.
Database createdObject = (Database)constructor.Invoke(null);

// Initialize the connection string property for the database.
createdObject.connectionString = sectionHandler.ConnectionString;

// Pass back the instance as a Database
return createdObject;
}
catch (Exception excep)
{
throw new Exception("Error instantiating database " + sectionHandler.Name + ". " + excep.Message);
}
}
}

It's important to note the use of .NET Reflection in the database factory. While this adds the extensibility and power for our database layer, it also adds a bit of overhead to processing. This overhead can be minimized, as you'll see below, by utilizing a static variable so that the number of times objects are instantiated by the factory is minimized.

Putting the Database Factory to Use

We've now implemented the C# ASP .NET database factory design pattern, using the built-in .NET generic database interfaces. To actually use the database factory, we'll create a data worker class to take care of handling how the database factory and generic database are used.

Our data worker class holds a static instance of the abstract Database class. In its constructor, we instantiate the concrete database (defined in the C# ASP .NET web applicaion's web.config file) by using our database factory design pattern. The data worker is defined as follows:

public class DataWorker
{
private static Database _database = null;

static DataWorker()
{
try
{
_database = DatabaseFactory.CreateDatabase();
}
catch (Exception excep)
{
throw excep;
}
}

public static Database database
{
get { return _database; }
}
}

Notice how, in the above code, there are no references to concrete database providers. Nowhere do we reference MSSQL, Oracle, or other concrete types. Everything is kept generic by using the abstract Database class and leaving the details of the concrete type inside the web.config file for the factory to access.

Now, whenever we create a manager class to perform business logic related to the database, we simply inherit from DataWorker. This gives the class instant access to the database routines. For example, we can now create a manager class as follows:

class MyDatabaseLogic : DataWorker
{
public void LoadFlowers()
{
using (IDbConnection connection = database.CreateOpenConnection())
{
using (IDbCommand command = database.CreateCommand("SELECT * FROM FLOWERS", connection))
{
using (IDataReader reader = command.ExecuteReader())
{
// read flowers and process ...
}
}
}
}
}

How About a Concrete Database Class?

Up until this point, we've created abstract and generic classes which defer the decision on which database type to actually use. Now, it's time to create a concrete implementation of the abstract Database object. You will create a concrete Database class for the type of database you plan on using (or may use in the future). If you end up needing to change the database provider, you can change the web.config to use a different concrete implementation.

For this example, we'll define an Oracle Database class as follows:

using Oracle.DataAccess.Client;

public class OracleDatabase : Database
{
public override IDbConnection CreateConnection()
{
return new OracleConnection(connectionString);
}

public override IDbCommand CreateCommand()
{
return new OracleCommand();
}

public override IDbConnection CreateOpenConnection()
{
OracleConnection connection = (OracleConnection)CreateConnection();
connection.Open();

return connection;
}

public override IDbCommand CreateCommand(string commandText, IDbConnection connection)
{
OracleCommand command = (OracleCommand)CreateCommand();

command.CommandText = commandText;
command.Connection = (OracleConnection)connection;
command.CommandType = CommandType.Text;

return command;
}

public override IDbCommand CreateStoredProcCommand(string procName, IDbConnection connection)
{
OracleCommand command = (OracleCommand)CreateCommand();

command.CommandText = procName;
command.Connection = (OracleConnection)connection;
command.CommandType = CommandType.StoredProcedure;

return command;
}

public override IDataParameter CreateParameter(string parameterName, object parameterValue)
{
return new OracleParameter(parameterName, parameterValue);
}

As you can see in the above code, we fill out the body for each abstract function defined in the Database class. You can customize the abstract and concrete classes further to perform more functionality.

Putting It All Together

Now that our C# ASP .NET database layer is complete, we can use the layer to refactor our original "Simple" database access code listed above. An example is shown below which replaces our Page_Load() database code with usage of our Manager class (which, in turn, uses the Database and factory classes).

class FlowerManager : DataWorker
{
public static void GetFlowers()
{
using (IDbConnection connection = database.CreateOpenConnection())
{
using (IDbCommand command = database.CreateCommand("SELECT * FROM FLOWERS", connection))
{
using (IDataReader reader = command.ExecuteReader())
{
// ...
}
}
}
}
}

protected void Page_Load(object sender, EventArgs e)
{
Flowers = FlowerManager.GetFlowers();

// Populate the flowers in a C# ASP .NET droplist control.
MyDropListControl.DataSource = Flowers;
MyDropListControl.DataBind();
}

Conclusion

The database layer is a powerful addition to the C# ASP .NET web application. It provides advanced extensibility, flexibility, and adaptation to change. By implementing the database layer with a database factory design pattern, we can add enhanced power to our architecture and better anticipate changes in database platforms and connections. Separating database code from application level code is a key method for providing better readability and maintenance of code in C# ASP .NET.

About the Author

This article was written by Kory Becker, founder and chief developer of Primary Objects, a software and web application development company. You can contact Primary Objects regarding your software development needs at http://www.primaryobjects.com

resource from http://www.primaryobjects.com


Read more!!!

Friday, September 19, 2008

Google Co-Founder Has Genetic Code Linked to Parkinson’s

MOUNTAIN VIEW, Calif. — Sergey Brin, a Google co-founder, said Thursday that he has a gene mutation that increases his likelihood of contracting Parkinson’s disease, a degenerative disorder of the central nervous system that can impair speech, movement and other functions.

Mr. Brin, who made the announcement on a blog, says he does not have the disease and that the exact implications of the discovery are not clear. Studies show that his likelihood of contracting Parkinson’s disease in his lifetime may be 20 percent to 80 percent, Mr. Brin said.

Mr. Brin, whose personal fortune was recently pegged at $15.9 billion by Forbes, ranking him as the 13th richest American, said that he may help provide more money for research into the disease.

Through a Google spokesman, Mr. Brin declined to be interviewed for this article.

Mr. Brin said he learned that he carries a mutation of the LRRK2 gene, known as G2019S. His mother, Eugenia Brin, also carries the gene mutation and has Parkinson’s.

Medical experts said that those who carry that gene mutation are more likely than not to live disease-free.

“Many people with this mutation never develop the disease,” said Dr. Susan B. Bressman, chairwoman of the neurology department at Beth Israel Medical Center in New York. “He is more likely to have a normal life than a Parkinson’s disease life.”

Dr. Bressman, who specializes in movement disorders and genetics, said that about 30 percent of people with the gene mutation develop the disease.

Mr. Brin said he discovered that he carried the gene mutation using a service from 23andMe, a biotechnology start-up co-founded by his wife, Anne Wojcicki. The company can map customers’ DNA and help them find information about their ancestry and their risk of getting certain diseases. Google, where Mr. Brin is president of technology, invested $3.9 million in 23andMe in May 2007.

Parkinson’s disease is typically a late-onset disorder, in which people often first exhibit symptoms in their 50s or 60s. Mr. Brin is 35. Symptoms, which can include tremors, stiffness, slowness of movement and speech impairment, can sometimes be managed through medication and surgery. While many people with the disease continue to function at a high level for many years, the disease is not curable and highly variable. Symptoms tend to become progressively worse over time.

“This leaves me in a rather unique position,” Mr. Brin wrote in his blog post. “I know early in my life something I am substantially predisposed to. I now have the opportunity to adjust my life to reduce those odds (e.g. there is evidence that exercise may be protective against Parkinson’s). I also have the opportunity to perform and support research into this disease long before it may affect me.”

Mr. Brin and his family have already endowed the Eugenia Brin Professorship in Parkinson’s Disease and Movement Disorders at the University of Maryland School of Medicine, where his mother is being treated.

Analysts said they did not believe that the news about Mr. Brin would have a negative impact on Google’s shares.


Read more!!!

Software spots the spin in political speeches

BLINK and you would have missed it. The expression of disgust on former US president Bill Clinton's face during his speech to the Democratic National Convention as he says "Obama" lasts for just a fraction of a second. But to Paul Ekman it was glaringly obvious.

"Given that he probably feels jilted that his wife Hillary didn't get the nomination, I would have to say that the entire speech was actually given very gracefully," says Ekman, who has studied people's facial expressions and how they relate to what they are thinking for over 40 years.

It seems that Clinton's micro-expression gave away more about his true feelings than he intended. Politicians do not usually give themselves away so tellingly, and many of us would like to know whether they mean what they are saying. So how are we to know when they are lying?

Technology is here to help. Software programs that analyse a person's speech, voice or facial expressions are building upon the work of researchers like Ekman to help us discover when the truth is being stretched, and even by how much. "The important thing to recognise is that politicians aren't typically good at out-and-out lies, but they are very adept at dancing around the truth," says David Skillicorn, a mathematics and computer science researcher at Queen's University in Kingston, Ontario, Canada. "The 2008 election has so far given us plenty of chances to see them in action."

Skillicorn has been watching out for verbal "spin". He has developed an algorithm that evaluates word usage within the text of a conversation or speech to determine when a person "presents themselves or their content in a way that does not necessarily reflect what they know to be true".

The algorithm counts usage of first person nouns - "I" tends to indicate less spin than "we", for example. It also searches out phrases that offer qualifications or clarifications of more general statements, since speeches that contain few such amendments tend to be high on spin. Finally, increased rates of action verbs such as "go" and "going", and negatively charged words, such as "hate" and "enemy", also indicate greater levels of spin. Skillicorn had his software tackle a database of 150 speeches from politicians involved in the 2008 US election race (see diagram).

When he analysed the speeches of John McCain, Barack Obama and Hillary Clinton, he found that even though the speeches were rehearsed, written by professionals and delivered by trained speakers, there were discernable differences between them. "It's clear that the speeches are still highly individualised," says Skillicorn. "This makes sense as the speeches have to, in some manner, reflect the speaker's own voice and opinions. Otherwise, they wouldn't be able to deliver them convincingly."

Additionally, he says, little details count: pronouns such as "we" and "I" are often substituted subconsciously, no matter what is written in the script.

Each of the candidates had made speeches containing very high and very low levels of spin, according to Skillicorn's program, depending on the occasion. In general though, Obama's speeches contain considerably higher spin than either McCain or Clinton. For example, for their speeches accepting their party's nomination for president, Obama's speech scored a spin value of 6.7 - where 0 is the average level of spin within all the political speeches analysed, and positive values represent higher spin. In contrast, McCain's speech scored -7.58, while Hillary Clinton's speech at the Democratic National Convention scored 0.15. Skillicorn also found that Sarah Palin's speeches contain slightly more spin than average.

So the analysis appears to back up McCain's claim that he is a "straight talker". However, for the purposes of political speech-making this may not be an entirely good thing for him. "Obama uses spin in his speeches very well," says Skillicorn. For example, Obama's spin level skyrockets when facing problems in the press, such as when Jeremiah Wright, the reverend of his former church, made controversial comments to the press.

"When you see these crises come along, the spin goes up," Skillicorn says. "Obama is very good at using stirring rhetoric to deal with the issues. And it seems to work if you look at what happens in the polls afterwards."

McCain does not seem as adept at using spin to his advantage, and his "straight talk" can make his speeches fall flat from a motivational point of view, according to Branka Zei Pollermann, founder of the Vox Institute in Geneva, Switzerland, who has analysed the candidates' voices for communication consultants Clearwater Advisors, based in London.

"The voice analysis profile for McCain looks very much like someone who is clinically depressed," says Pollermann, a psychologist who uses voice analysis software in her work with patients. Previous research on mirror neurons has shown that listening to depressed voices can make others feel depressed themselves, she says.
"John McCain's voice analysis profile looks like that of someone who is clinically depressed"

Pollermann uses auditory analysis software to map seven parameters of a person's speech, including pitch modulation, volume and fluency, to create a voice profile. She then compares that profile with the speaker's facial expressions, using as a guide a set of facial expressions mapped out by Ekman, called the Facial Action Coding System, to develop an overall picture of how they express themselves.

Her analysis shows that McCain's voice changes little in pitch as he speaks, and so conveys very little emotion or impact. Whether he is addressing positive prospects or discussing sad facts, his voice always sounds the same.

Additionally, McCain's voice and facial movements often do not match up, says Pollermann, and he often smiles in a manner that commonly conveys sarcasm when addressing controversial statements. "That might lead to what I would call a lack of credibility."

People are unlikely to trust statements made in a flat tone, particularly when they do not match the person's facial expressions. According to Pollermann's analysis, it may not make any difference that McCain does not pepper his speeches with spin, if the way he talks does not strike people as believable.

Obama, by comparison, speaks with greater pitch modulation, and his facial expressions correlate very well with what he is saying. His one facial foible may be a tendency to furrow his brow, she says, conveying constant concern. This is similar to the UK prime minister Gordon Brown, whose expressions tend to be limited to sadness, anger and disgust, according to the Vox Institute's analysis. But Obama's fluency, high speech rate and good use of pitch make him a dynamic speaker.

So what does all of this actually say about the honesty of politicians? "Our society treats political candidates like used-car salesmen," Ekman says. "The fact is that the candidates almost certainly believe what they are saying, even if they are giving some facts a much lighter treatment than others. In that way, actually catching someone in a blatant lie is relatively rare."

Indeed, Bill Clinton's fleeting facial slip was the only clear example that Ekman could recount of a politician saying something that they did not mean during both the Republican and Democratic national conventions.

However, facial recognition technology may one day be able to pick up on telltale signs that humans would have trouble spotting. For example, Yoshimasa Ohmoto and colleagues at the University of Tokyo in Japan are developing a facial recognition system for robots and artificial intelligence agents that analyses basic eye, nose and mouth movements, such as a slightly averted gaze when talking to someone, to detect if a person is telling a lie. In trials in which people played the bluffing game Indian poker, the system has already proved to be as reliable as humans trained to detect lies (AI & Society, vol 23, p 187).

"Technology is quickly catching up with psychology," says Pawan Sinha, who leads a team at the Massachusetts Institute of Technology that specialises in computerised facial-recognition technology. "It's not quite there yet, because the visualisation systems just can't work fast enough to replace the human eye and mind. But computer processing is getting faster and our recognition systems are getting better," he says. "Someday soon, computers may be able read us better than any psychologist. I imagine that will be a pretty scary day for politicians."


Read more!!!

Outsourcing

Overview

Outsourcing involves the transfer of the management and/or day-to-day execution of an entire business function to an external service provider. The client organization and the supplier enter into a contractual agreement that defines the transferred services. Under the agreement the supplier acquires the means of production in the form of a transfer of people, assets and other resources from the client. The client agrees to procure the services from the supplier for the term of the contract. Business segments typically outsourced include information technology, human resources, facilities, real estate management, and accounting. Many companies also outsource customer support and call center functions like telemarketing, cad drafting, customer service, market research, manufacturing, designing, web development, content writing, ghostwriting and engineering.

Outsourcing and offshoring are used interchangeably in public discourse despite important technical differences. Outsourcing involves contracting with a supplier, which may or may not involve some degree of offshoring. Offshoring is the transfer of an organizational function to another country, regardless of whether the work is outsourced or stays within the same corporation/company.

With increasing globalization of outsourcing companies, the distinction between outsourcing and offshoring will become less clear over time. This is evident in the increasing presence of Indian outsourcing companies in the US and UK. The globalization of outsourcing operating models has resulted in new terms such as nearshoring, noshoring, and rightshoring that reflect the changing mix of locations. This is seen in the opening of offices and operations centers by Indian companies in the U.S. and UK

Multisourcing refers to large (predominantly IT) outsourcing agreements. Multisourcing is a framework to enable different parts of the client business to be sourced from different suppliers. This requires a governance model that communicates strategy, clearly defines responsibility and has end-to-end integration.

Strategic outsourcing is the organizing arrangement that emerges when firms rely on intermediate markets to provide specialized capabilities that supplement existing capabilities deployed along a firm’s value chain (see Holcomb & Hitt, 2007). Such an arrangement produces value within firms’ supply chains beyond those benefits achieved through cost economies. Intermediate markets that provide specialized capabilities emerge as different industry conditions intensify the partitioning of production. As a result of greater information standardization and simplified coordination, clear administrative demarcations emerge along a value chain. Partitioning of intermediate markets occurs as the coordination of production across a value chain is simplified and as information becomes standardized, making it easier to transfer activities across boundaries.

Process of outsourcing

Deciding to outsource

The decision to outsource is taken at a strategic level and normally requires board approval. Outsourcing is the divestiture of a business function involving the transfer of people and the sale of assets to the supplier. The process begins with the client identifying what is to be outsourced and building a business case to justify the decision. Only once a high level business case has been established for the scope of services will a search begin to choose an outsourcing partner.

Supplier proposals

A Request for Proposal (RFP) is issued to the shortlist suppliers requesting a proposal and a price. The suppliers are usually chosen based on location and at the lowest possible cost to the company.

Supplier competition

A competition is held where the client marks and scores the supplier proposals. This may involve a number of face-to-face meetings to clarify the client requirements and the supplier response. The suppliers will be qualified out until only a few remain. This is known as down select in the industry. It is normal to go into the due diligence stage with two suppliers to maintain the competition. Following due diligence the suppliers submit a "best and final offer" (BAFO) for the client to make the final down select decision to one supplier. It is not unusual for two suppliers to go into competitive negotiations.

Negotiations

The negotiations take the original RFP, the supplier proposals, BAFO submissions and convert these into the contractual agreement between the client and the supplier. This stage finalizes the documentation and the final pricing structure.

Contract finalization

At the heart of every outsourcing deal is a contractual agreement that defines how the client and the supplier will work together. This is a legally binding document and is core to the governance of the relationship. There are three significant dates that each party signs up to the contract signature date, the effective date when the contract terms become active and a service commencement date when the supplier will take over the services.

Transition

The transition will begin from the effective date and normally run until four months after service commencement date. This is the process for the staff transfer and the take-on of services.

Transformation

The transformation is the execution of a set of projects to implement the service level agreement (SLA), to reduce the total cost of ownership (TCO) or to implement new services. Emphasis is on 'standardisation' and 'centralisation'.

Ongoing service delivery

This is the execution of the agreement and lasts for the term of the contract.

Termination or renewal

Near the end of the contract term a decision will be made to terminate or renew the contract. Termination may involve taking back services (insourcing) or the transfer of services to another supplier.

Reasons for outsourcing

Organizations that outsource are seeking to realize benefits or address the following issues:

* Cost savings. The lowering of the overall cost of the service to the business. This will involve reducing the scope, defining quality levels, re-pricing, re-negotiation, cost re-structuring. Access to lower cost economies through offshoring called "labor arbitrage" generated by the wage gap between industrialized and developing nations.
* Cost restructuring. Operating leverage is a measure that compares fixed costs to variable costs. Outsourcing changes the balance of this ratio by offering a move from variable to fixed cost and also by making variable costs more predictable.
* Improve quality. Achieve a step change in quality through contracting out the service with a new service level agreement.
* Knowledge. Access to intellectual property and wider experience and knowledge.
* Contract. Services will be provided to a legally binding contract with financial penalties and legal redress. This is not the case with internal services.
* Operational expertise. Access to operational best practice that would be too difficult or time consuming to develop in-house.
* Staffing issues. Access to a larger talent pool and a sustainable source of skills.
* Capacity management. An improved method of capacity management of services and technology where the risk in providing the excess capacity is borne by the supplier.
* Catalyst for change. An organization can use an outsourcing agreement as a catalyst for major step change that can not be achieved alone. The outsourcer becomes a Change agent in the process.
* Reduce time to market. The acceleration of the development or production of a product through the additional capability brought by the supplier.
* Commodification. The trend of standardizing business processes, IT Services and application services enabling businesses to intelligently buy at the right price. Allows a wide range of businesses access to services previously only available to large corporations.
* Risk management. An approach to risk management for some types of risks is to partner with an outsourcer who is better able to provide the mitigation.

Criticisms of outsourcing

Public opinion

There is a strong public opinion regarding outsourcing (especially when combined with offshoring) that outsourcing damages a local labor market. Outsourcing is the transfer of the delivery of services which affects both jobs and individuals. It is difficult to dispute that outsourcing has a detrimental effect on individuals who face job disruption and employment insecurity; however, its supporters believe that outsourcing should bring down prices, providing greater economic benefit to all. There are legal protections in the European Union regulations called the Transfer of Undertakings (Protection of Employment). Labor laws in the United States are not as protective as those in the European Union. A study has attempted to show that public controversies about outsourcing in the U.S. have much more to do with class and ethnic tensions within the U.S. itself, than with actual impacts of outsourcing.

Failure to realize business value

The main business criticism of outsourcing is that it fails to realize the business value that the outsourcer promised the client.

Language skills

In the area of call centers end-user-experience is deemed to be of lower quality when a service is outsourced. This is exacerbated when outsourcing is combined with off-shoring to regions where the first language and culture are different. The questionable quality is particularly evident when call centers that service the public are outsourced and offshored.

There are a number of the public who find the linguistic features such as accents, word use and phraseology different which may make call center agents difficult to understand. The visual clues that are present in face-to-face encounters are missing from the call center interactions and this also may lead to misunderstandings and difficulties.

Social responsibility

Outsourcing sends jobs to the lower-income areas where work is being outsourced to, which provides jobs in these areas and has a net equalizing effect on the overall distribution of wealth. Some argue that the outsourcing of jobs (particularly off-shore) exploits the lower paid workers. A contrary view is that more people are employed and benefit from paid work.

On the issue of high-skilled labor, such as computer programming, some argue that it is unfair to both the local and off-shore programmers to outsource the work simply because the foreign pay rate is lower. On the other hand, one can argue that paying the higher-rate for local programmers is wasteful, or charity, or simply overpayment. If the end goal of buyers is to pay less for what they buy, and for sellers it is to get a higher price for what they sell, there is nothing automatically unethical about choosing the cheaper of two products, services, or employees.

Quality of service

Quality of service is measured through a service level agreement (SLA) in the outsourcing contract. In poorly defined contracts there is no measure of quality or SLA defined. Even when an SLA exists it may not be to the same level as previously enjoyed. This may be due to the process of implementing proper objective measurement and reporting which is being done for the first time. It may also be lower quality through design to match the lower price.

There are a number of stakeholders who are affected and there is no single view of quality. The CEO may view the lower quality acceptable to meet the business needs at the right price. The retained management team may view quality as slipping compared to what they previously achieved. The end consumer of the service may also receive a change in service that is within agreed SLAs but is still perceived as inadequate. The supplier may view quality in purely meeting the defined SLAs regardless of perception or ability to do better.

Quality in terms of end-user-experience is best measured through customer satisfaction questionnaires which are professionally designed to capture an unbiased view of quality. Surveys can be one of research. This allows quality to be tracked over time and also for corrective action to be identified and taken.

Staff turnover

The staff turnover of employee who originally transferred to the outsourcer is a concern for many companies. Turnover is higher under an outsourcer and key company skills may be lost with retention outside of the control of the company.

In outsourcing offshore there is an issue of staff turnover in the outsourcer companies call centers. It is quite normal for such companies to replace its entire workforce each year in a call center. This inhibits the build-up of employee knowledge and keeps quality at a low level.

Company knowledge

Outsourcing could lead to communication problems with transferred employees. For example, before transfer staff have access to broadcast company e-mail informing them of new products, procedures etc. Once in the outsourcing organization the same access may not be available. Also to reduce costs, some outsource employees may not have access to e-mail, but any information which is new is delivered in team meetings.

Qualifications of outsourcers

The outsourcer may replace staff with less qualified people or with people with different non-equivalent qualifications.

In the engineering discipline there has been a debate about the number of engineers being produced by the major economies of the United States, India and China. The argument centers around the definition of an engineering graduate and also disputed numbers. The closest comparable numbers of annual gradates of four-year degrees are United States (137,437) India (112,000) and China (351,537).

Work, labour, and economy

Net labour movements

Productivity

Offshore outsourcing for the purpose of saving cost can often have a negative influence on the real productivity of a company. Rather than investing in technology to improve productivity, companies gain non-real productivity by hiring fewer people locally and outsourcing work to less productive facilities offshore that appear to be more productive simply because the workers are paid less. Sometimes, this can lead to strange contradictions where workers in a third world country using hand tools can appear to be more productive than a U.S. worker using advanced computer controlled machine tools, simply because their salary appears to be less in terms of U.S. dollars.

In contrast, increases in real productivity are the result of more productive tools or methods of operating that make it possible for a worker to do more work. Non-real productivity gains are the result of shifting work to lower paid workers, often without regards to real productivity. The net result of choosing non-real over real productivity gain is that the company falls behind and obsoletes itself overtime rather than making real investments in productivity.

Standpoint of labor

From the standpoint of labor within countries on the negative end of outsourcing this may represent a new threat, contributing to rampant worker insecurity, and reflective of the general process of globalization (see Krugman, Paul (2006). "Feeling No Pain." New York Times, March 6, 2006). While the "outsourcing" process may provide benefits to less developed countries or global society as a whole, in some form and to some degree - include rising wages or increasing standards of living - these benefits are not secure. Further, the term outsourcing is also used to describe a process by which an internal department, equipment as well as personnel, is sold to a service provider, who may retain the workforce on worse conditions or discharge them in the short term. The affected workers thus often feel they are being "sold down the river."

The U.S.

'Outsourcing' became a popular political issue in the United States during the 2004 U.S. presidential election. The political debate centered on outsourcing's consequences for the domestic U.S. workforce. Democratic U.S. presidential candidate John Kerry criticized U.S. firms that outsource jobs abroad or that incorporate overseas in tax havens to avoid paying their fair share of U.S. taxes during his 2004 campaign, calling such firms "Benedict Arnold corporations". Criticism of outsourcing, from the perspective of U.S. citizens, by-and-large, revolves around the costs associated with transferring control of the labor process to an external entity in another country. A Zogby International poll conducted in August 2004 found that 71% of American voters believed that “outsourcing jobs overseas” hurt the economy while another 62% believed that the U.S. government should impose some legislative action against companies that transfer domestic jobs overseas, possibly in the form of increased taxes on companies that outsource. One given rationale is the extremely high corporate income tax rate in the U.S. relative to other OECD nations, and the peculiar practice of taxing revenues earned outside of U.S. jurisdiction, a very uncommon practice. It is argued that lowering the corporate income tax and ending the double-taxation of foreign-derived revenue (taxed once in the nation where the revenue was raised, and once from the U.S.) will alleviate corporate outsourcing and make the U.S. more attractive to foreign companies. Sarbanes-Oxley has also been cited as a factor for corporate flight from U.S. jurisdiction.

Policy solutions to outsourcing are also criticized.

Security

Before outsourcing an organization is responsible for the actions of all their staff and liable for their actions. When these same people are transferred to an outsourcer they may not change desk but their legal status has changed. They no-longer are directly employed or responsible to the organization. This causes legal, security and compliance issues that need to be addressed through the contract between the client and the suppliers. This is one of the most complex areas of outsourcing and requires a specialist third party adviser.

Fraud

Fraud is a specific security issue that is criminal activity whether it is by employees or the supplier staff. However, it can be disputed that the fraud is more likely when outsourcers are involved, for example about the credit card theft when there is scope for fraud by credit card cloning. In April 2005, a high-profile case involving the theft of $350,000 from four Citibank customers occurred when call center workers acquired the passwords to customer accounts and transferred the money to their own accounts opened under fictitious names. Citibank did not find out about the problem until the American customers noticed discrepancies with their accounts and notified the bank.


Read more!!!