Question: Module `A` relies on module `B`, and class `C` relies on modules `A` and `B`. If I include `A` and `B` into `C`, this works, but I do not like the fact that `A` has a dependency on another module that must be mixed in along with it for it to work.

What is the "right" way to mix in modules in this situation? Should `A` mix in `B` itself? What if `C` also uses `B` directly?

```
module B
  def g
    12
  end
end

module A
  def f
    2 * g
  end
end

class C
  include A, B

  def h
    3 * f
  end
end

```

Answer: 
Nothing is wrong with writing `include` redundantly. If `A` and `C` both rely on `B`, then include `B` in both `A` and `C`.

```
module B
  def g; 12 end
  def i; 7 end
end

module A
  include B
  def f; 2 * g end
end

class C
  include A, B
  def h; 3 * f * i end
end

```

If `C` does no rely on `B`, then include `B` only in `A`.

```
module B
  def g; 12 end
end

module A
  include B
  def f; 2 * g end
end

class C
  include A
  def h; 3 * f end
end

```
I dont see anything wrong with just including B inside A if A depends on B and your modules only define instance methods. If you need class methods, you might want to consider <http://api.rubyonrails.org/classes/ActiveSupport/Concern.html>

```
module B
  def method_b
    "B instance method"
  end
end

module A
  include B

  def method_a
    "A instance method is using #{method_b}"
  end
end

class Klass
  include A
end

k = Klass.new
puts k.method_a  #=> A instance method is using B instance method
puts k.method_b  #=> B instance method
puts k.class.ancestors.inspect  #=> [Klass, A, B, Object, Kernel, BasicObject]

```