Asperger’s and OCD share some commonalities. Asperger’s is similar to autism (see previous question and answer), but without the lack of difficulty in language development.
According to the DSMIV-TR (2000), Asperger’s is a developmental disorder that involves significant impairment in social interaction (such as minimal eye contact or a failure to develop social relationships) and repetitive or stereotyped patterns of behavior or interest. It is this second area where OCD and Asperger’s can overlap.
However, there are ways to differentiate between the two disorders. People with Asperger’s have a preoccupation with a certain subject or object that does not bring them distress, in fact, they often enjoy it. An obsession would bring someone with OCD distress.
Second, although people with Asperger’s do have routines that they follow with very little variation, the behavior is not done in response to an obsession.
It’s true that OCD can be diagnosed just based on the performance of inflexible routines not spurred by an obsession, but if this pattern of behavior is accompanied by difficulties in social interaction starting in early childhood, then Asperger’s disorder is a better diagnosis.
If there are no apparent difficulties in social interaction, then OCD may be the best diagnosis. Of course, it is possible to be diagnosed with both disorders as well.