I am new to spring and exploring it, I want to my spring container to create all objects from a specific package.

Circle Class:

```
@Component
public class Circle extends AbstractShape  {

@Override
public void draw() {

}

@Override
public int calculateArea(int x, int y) {
    return (int) (3.14 * x * y);
}

```

}

Square Class:

```
@Component
public class Square extends AbstractShape {
    @Override
    public void draw() {

    }

    @Override
    public int calculateArea(int x, int y) {
        return x * y;
    }
}

```

My spring config class which basically create bean defination for me:

```
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ShapeConfig {

    @Bean
    public Circle getCircle() {
        return new Circle();
    }

    @Bean
    public Square getSquare() {
        return new Square();
    }
}

```

I want my bean definition to be created which extends class "AbstractShape", and want to avoid providing one by one bean definition in my config class. Please suggest possible ways to do so.

Thanks in Advance,

Priyank