@Component
public class Product {
private String name;
private BigDecimal value;
//... getters and setters
}
@Repository
public class ProductRepository {
// database transaction methods
}
@Service
public class ProductService {
// business rules
}
@Controller
public class ProductController {
// ... GET, POST, DELETE, UPDATE methods
}