Compartmentalization can take place in borderline personality disorder, as people tend to engage in black-and-white thinking—a partner is either perfect or terrible, for instance. Borderline is also characterized by an unstable and incongruent self-concept. Research shows that those with borderline tend to compartmentalize parts of their identity—viewing themselves completely negatively or completely positively at one time—more than people with depression and people without a mental health condition.
For more, see Borderline Personality Disorder.