Pages

Thursday, April 4, 2013

Employees leave managers, not companies

Today I found out one of my good friends left their position at a well-known technology company that many people would “kill” to work for. I asked him why he left, expecting an answer like “I needed more of a challenge”, or “I outgrew the position and there was nowhere for me to grow”, but instead he said “I couldn’t work with my boss”.

As he said this I thought about all the people leaving their positions because they simply couldn’t work with their manager. The work was stimulating, the team was great but their manager was unbearable to work with. In these situations, what seems to happen is companies lose good employees on a regular basis and all the managers sit around a conference table trying to address employee attrition, developing strategies for employee retention.

Employee retention is a real problem that all managers face. The key to being able to keep the good employees is not so much the salary you offer them or even the actual work, it is more about how you manage them and how they feel working under you as their manager. Do they feel valued within your team? Do you provide them with timely feedback? Do they feel your support as a manager leading their team or company?

Abraham Maslow was an American psychologist who was best known for creating Maslow’s hierarchy of needs which can be seen below.

Source: Diana Vanbrabant

As a manager we are able to affect three levels of needs within this hierarchy – safety, love & belonging and esteem. These 3 levels represents different elements within the workplace. The first level - safety refers to job security, career progression as well as health benefits and perhaps even gym membership. How do your employees feel about their job? Are they constantly afraid of cuts due to the recession? Do they know that as a manager you care about their wellbeing as well as their work?

The next level is love and belonging. People want to feel as if they are making a difference and are part of something bigger. As a manager how you approach giving out tasks, mentoring employees and interacting with them show how much you value their work. It is your duty as a manager to show employees how their work is making a difference and is part of a much larger plan. The worst thing for an employee is for them to think they are just another cog in a machine.

The last level is esteem. This refers to confidence and respect. It is important to manage your staff in terms of how they feel towards the work and to their peers and managers. Respect within the workplace is extremely important and can be the difference between keeping a good employee or losing them. Training and development when necessary is a good way to boost confidence and equip staff with the right skills. Investing in your staff to help them upskill benefits both the company and the employees. Zig Ziglar once said that there was only one thing worse than training (or growing) your staff and having them leave, and that is not training or developing them and having them stay.

A Florida State University (FSU) professor and two of his doctoral students have conducted a study which highlights the impacts of an abusive or poor manager/boss. They surveyed over 700 people who work in a variety of jobs and asked for their opinions of supervisor treatment on the job.

The study revealed these results:

39%: Their supervisor failed to keep promises
37%: Their supervisor failed to give credit when due
31%: Their supervisor gave them the “silent treatment” in the past year.
27%: Their supervisor made negative comments about them to other employees or managers.
24%: Their supervisor invaded their privacy.
23%: Their supervisor blames others to cover up mistakes or minimize embarrassment

Source: Florida State University

These points act as a good checklist to see how you are managing your staff because at the end of the day employees leave managers and bosses, not companies!

 

Tuesday, March 26, 2013

Create database from existing mdf file in sql server

EXEC sp_attach_single_file_db @dbname = 'AdventureWorks2012_Data',

@physname = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\data\AdventureWorks2012_Data.mdf'

 

Tuesday, March 19, 2013

DataContract and MessageContract

1. Comparison

Data Contracts

WCF data contracts provide a mapping function between .NET CLR types that are defined in code and XML Schemas Definitions defined by the W3C organization (www.w3c.org/) that are used for communication outside the service.

you can say “Data contract is a formal agreement between a service and a client that abstractly describes the data to be exchanged”. That is, to communicate, the client and the service do not have to share the same types, only the same data contracts. A data contract precisely defines, for each parameter or return type, what data is serialized (turned into XML) to be exchanged.

Message Contracts

Message contracts describe the structure of SOAP messages sent to and from a service and enable you to inspect and control most of the details in the SOAP header and body. Whereas data contracts enable interoperability through the XML Schema Definition (XSD) standard, message contracts enable you to interoperate with any system that communicates through SOAP.

Using message contracts gives you complete control over the SOAP message sent to and from a service by providing access to the SOAP headers and bodies directly. This allows use of simple or complex types to define the exact content of the SOAP parts.

2. Why use MessageContract when DataContract is there?

Data contracts are used to define the data structure. Messages that are simply a .NET type, lets say in form of POCO (plain old CLR object), and generate the XML for the data you want to pass.

Message contracts are preferred only when there is a need to “control” the layout of your message(the SOAP message); for instance, adding specific headers/footer/etc to a message.

Sometimes complete control over the structure of a SOAP message is just as important as control over its contents. This is especially true when interoperability is important or to specifically control security issues at the level of the message or message part. In these cases, you can create a message contract that enables you to use a type for a parameter or return value that serializes directly into the precise SOAP message that you need.

3. Why we use MessageContract to pass SOAP headers ?

Passing information in SOAP headers is useful if you want to communicate information “out of band” from the operation signature.

For instance, session or correlation information can be passed in headers, rather than adding additional parameters to operations or adding this information as fields in the data itself.

Another example is security, where you may want to implement a custom security protocol (bypassing WS-Security) and pass credentials or tokens in custom SOAP headers.

A third example, again with security, is signing and encrypting SOAP headers, where you may want to sign and/or encrypt some or all header information. All these cases can be handled with message contracts. The downside with this technique is that the client and service must manually add and retrieve the information from the SOAP header, rather than having the serialization classes associated with data and operation contracts do it for you.

4. Can’t mix datacontracts and messagecontracts.

Because message-based programming and parameter-based programming cannot be mixed, so you cannot specify a DataContract as an input argument to an operation and have it return a MessageContract, or specify a MessageContract as the input argument to an operation and have it return a DataContract. You can mix typed and untyped messages, but not messageContracts and DataContracts. Mixing message and data contracts will cause a runtime error when you generate WSDL from the service.