Junior — Senior
Definition of Spring Beans for Warehouse and Employee Model
livecode
Task condition
There are three entities: Warehouse, Worker, and Product.
Worker is responsible for adding a Product to the Warehouse. Inside the Warehouse, a method addProduct() is implemented, which delegates the call to its Worker. After execution, the Worker places the Product object into the internal list of warehouse products.
It is required to describe the following using the Spring Framework:
- Model classes:
Warehouse,Worker,Product. - The logic of their interaction when adding a product.
- Indicate which of these classes should be configured as Spring beans (for example, with annotations like
@Component,@Service,@Repository, etc.).