Mixins vs OOP

Hi all !

Being new to Ruby, I was toying with Rack and trying to build a simple
request/response web framework. I coded this :

class Controller

include HTTP

def initialize(env)
@env = env
end

end

module HTTP

include Request
include Response

end

module Request

def method

end

def uri

end

end

module Response

def ok

end

end

Is it a good idea to extensively use mixins like this ? Rather than
being 100% object-oriented ?

Thanks !

On Mon, May 27, 2013 at 3:12 PM, Sbastien D.
[email protected]wrote:

Being new to Ruby, I was toying with Rack and trying to build a simple
request/response web framework. I coded this :

Is it a good idea to extensively use mixins like this ? Rather than
being 100% object-oriented ?

It’s still OO. Other than that your question is probably difficult to
answer with so little input. Since you do not use those mixins in
multiple
places I would probably say: not necessary. I would certainly question
module HTTP. That seems overhead and should probably merged with
Controller. But, as I said, little input, so please take the answer
with a
grain of salt.

Kind regards

robert