---
title: Events and DI | Shopware Community Hub
description: >-
  Learn intermediate concepts of Shopware plugin development, including event
  handling, dependency injection, and plugin lifecycle management.
canonical_url: 'https://hub.shopware.com/learn/course/events-and-di'
---

# Events and DI

<LearningObjectives>

- Understand how Shopware's event system works and how to create event subscribers.
- Learn how dependency injection and services are used.
- Apply best practices for keeping subscribers lightweight and reusable, and maintainable.
- Understand the Shopware plugin lifecycle and how updates and migrations are handled.

</LearningObjectives>

# Events and DI

Events and dependency injection are core concepts for extending Shopware in a scalable and maintainable way without modifying core code.

In this course, you'll learn how Shopware plugins react to system events, how business logic is structured using services, and learn the plugin lifecycle management.

## Learning Approach

This course focuses on **practical understanding**, not theory overload. You'll explore real-world examples that show how events, services, and lifecycle management work in Shopware plugins.

By the end of this course, you'll be able to design plugins that integrate cleanly into Shopware's architecture.

## Example Plugin

Throughout this course, we'll be working with the **AcademyReviewExtension** plugin, which demonstrates intermediate plugin development concepts including event handling, dependency injection, and lifecycle management.

### Getting the Plugin

You can clone the plugin to follow along with the examples:

```shell
cd custom/plugins
git clone git@github.com:ShopwareAcademy/AcademyReviewExtension.git
cd AcademyReviewExtension
```

## Learning Units

## Units
- [Dependency Injection and Services](/learn/unit/dependency-injection-and-services): Learn how to use dependency injection, create and register services, and apply best practices for structuring business logic in Shopware plugins.
- [Event System and Subscribers](/learn/unit/event-system-and-subscribers): Learn how to work with Shopware’s event system, create custom subscribers, and handle events effectively.
- [Plugin Lifecycle Management](/learn/unit/plugin-lifecycle-management): Learn the Shopware plugin lifecycle, including installation, activation, updates, uninstallation, deactivation and database migrations.
