# Module design acceptable practices questions

**URL:** <https://www.ruby-forum.com/t/module-design-acceptable-practices-questions/195766>\
**Category:** Ruby\
**Created:** [September 29, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/module-design-acceptable-practices-questions/195766 "2010-09-29T20:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mydarkpassenger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/82dd89/32.png) [@mydarkpassenger](https://www.ruby-forum.com/u/mydarkpassenger)\
**Post date:** [September 29, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/module-design-acceptable-practices-questions/195766/1 "2010-09-29T20:56:30Z")

</div>

Module design acceptable practices questions…

1. Is it “accepted” practice to prohibit a particular module from being  
extended or included? Or should a module, “normally” be able to be  
included and extended?

2. Is it an “accepted” practice to both include AND extend a module in a  
given class?

---

<div class="post-metadata">

**Author:** ![mydarkpassenger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/82dd89/32.png) [@mydarkpassenger](https://www.ruby-forum.com/u/mydarkpassenger)\
**Post date:** [September 29, 2010, 10:37pm UTC](https://www.ruby-forum.com/t/module-design-acceptable-practices-questions/195766/2 "2010-09-29T22:37:50Z")

</div>

On Wed, Sep 29, 2010 at 8:56 PM, Gene A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Module design acceptable practices questions…
> 
> 1. Is it “accepted” practice to prohibit a particular module from being  
> extended or included? Or should a module, “normally” be able to be  
> included and extended?

I cannot recall having seen a module implementer attempt this. If at  
all I guess it is a rather rare practice to try to do this and frankly  
I believe this does not fit very well to Ruby’s otherwise rather  
relaxed approach (e.g. you can get around private methods rather  
easily).

> 1. Is it an “accepted” practice to both include AND extend a module in a  
> given class?

I would only do one or the other but I might have seen other examples.

Kind regards

robert
