Question: I am trying [ZIO](https://zio.dev).

I do not understand why `Live` is added as `Trait`, and then an `object` is provided, like:

```
object Live extends Live

```

This pattern is found in different places, for example `zio.console.Console`.

Is there a reason, or are there cases where this makes sense?

Answer: 
What you see in **ZIO** is the usage of a pattern called *Selfless Trait*.

To implement the selfless trait pattern you simply provide a companion object for a trait that itself mixes in the trait.

```
trait Greeting {
  def greet() { println("hi there") }
}

object Greeting extends Greeting

```

Then the user of the library has the choice to either mix-in `Greeting`:

```
object MixinExample extends Application with Greeting {
  greet()
}

```

or to import the members of the `Greeting` companion object, like this:

```
import Greeting._

object ImportExample extends Application {
  greet()
}

```
Just as an addition to *Krzysztof Atłasik* answer.

As mentioned in *jq170727* comment you find these two cases here:  

[introduce-a-database-module](http://degoes.net/articles/testable-zio#introduce-a-database-module)

`Object`:

> 
> In the worst case, if we are pressed for time and need to ship code
>  today, maybe we choose to provide the production database wherever we
>  call inviteFriends.
> 
> 
> 

```
inviteFriends(userId).provide(DatabaseLive)

```

> 
> In this case, instead of using the DefaultRuntime that ships with ZIO,
>  we can define our own Runtime, which provides the production database
>  module):
> 
> 
> 

```
val myRuntime = Runtime(DatabaseLive, PlatformLive)

```

`Trait`:

When you have multiple *Runtimes*.

```
val myRuntime = 
  Runtime(
    new  DatabaseLive 
    with SocialLive 
    with EmailLive, PlatformLive)

```