Adding component to component

Hi, i am new to component object models. Here is what i want to achieve.

I have an actor component for my game objects. The actor component as a private field of type behavior. I need to be able to extend the behavior class and add it to the actor. Like this.

11221-seri.png

Do you want to switch between behaviors at runtime? Declare your behavior field like you have already. When you want to add a different behavior simply destroy the old one and add the new:

Destroy(behavior);
behaviour = gameObject.AddComponent(typeof(Attack));