> ## Content Index
> Fetch the complete content index at: https://madewithlove.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# *AwareInterfaces: simple interfaces with getter and setter
- URL: https://madewithlove.com/blog/aware-interfaces-getter-setter/
- Published: 2015-09-29T16:11:00.000Z
- Updated: 2026-05-29T11:58:49.000Z
- Author: Hannes Van De Vreken
- Tags: Engineering, Code quality

Sometimes you see simple interfaces with a getter and a setter for a specific type of object. Some examples are `league/event`‘s `EmitterAwareInterface` and `league/container`‘s `ImmutableContainerAwareInterface`. Also Zend Framework 2 has a ton of `*AwareInterface`s like (but not limited to) these:

These packages often come with a reusable trait that gives you pluggable implementations for these interfaces out of the box. For previous examples there are the `EmitterAwareTrait` and the `ImmutableContainerAwareTrait`.

I find these interfaces useful for setting up an IoC container to automatically “setter-inject” a dependency. With Laravel 5.0+’s container one can configure this:

With `league/container`‘s container one can use so called `inflectors`:

Now if you resolve any kind of object from the IoC container, it will have an `EmitterInterface` (or `ImmutableContainer`) object injected for you.

Cheers!