---
title: "Comment by Nick F on \"Self Type in Scala\" | Hashnode"
description: "Self Type as Dependency Have you used this in the wild? It seems interesting, but not sure when I would use it. Perhaps if I don&#39;t control the Vehicle trait"
url: "https://hashnode.com/posts/self-type-in-scala/62a36a80165482d2b3ee9b9d/comment/631b74a0f73f4734bc051f95"
---

[Discussion](https://hashnode.com/posts/self-type-in-scala/62a36a80165482d2b3ee9b9d)

Comment [Self Type in Scala](https://hashnode.com/posts/self-type-in-scala/62a36a80165482d2b3ee9b9d)

[Nick F](https://hashnode.com/@sevengraff)

[Sep 9, 2022](https://hashnode.com/posts/self-type-in-scala/62a36a80165482d2b3ee9b9d/comment/631b74a0f73f4734bc051f95)

> Self Type as Dependency

Have you used this in the wild? It seems interesting, but not sure when I would use it. Perhaps if I don't control the `Vehicle` trait, but I want to extend it? But Scala has Extension Methods to do this as well. When should I use one or the other? I haven't had to use Extension Methods either. Perhaps this is more for building Libraries and not Applications?

> Self Type as Tagging

This remind me a lot of `var that = this;` in JavaScript haha, brings me back. :-)

[Yadukrishnan](https://hashnode.com/@yadukrishnan)

[Sep 16, 2022](https://hashnode.com/posts/self-type-in-scala/62a36a80165482d2b3ee9b9d/comment/631b74a0f73f4734bc051f95#reply-632483f2bc15ea8efdf5db4d)

Hey [Nick F](https://hashnode.com/@sevengraff), Self Type as a dependency is widely used in Scala libraries. Overusing it can make it a pain. This is how "cake pattern" is implemented.
