# Engine best practices

**URL:** <https://www.ruby-forum.com/t/engine-best-practices/111333>\
**Category:** Rails\
**Created:** [August 6, 2007, 5:04am UTC](https://www.ruby-forum.com/t/engine-best-practices/111333 "2007-08-06T05:04:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [August 6, 2007, 5:04am UTC](https://www.ruby-forum.com/t/engine-best-practices/111333/1 "2007-08-06T05:04:10Z")

</div>

Never worked with engines before so maybe there are some tricks I’m  
not familiar with. Say you have a decent sized engine. Before too  
long you take the chance of creating naming conflicts with the app  
that uses your engine.

The best way I can think of to deal with this is to put everything in  
a namespace. Are there any other solutions I’m not thinking of?

Chris

---

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [August 6, 2007, 11:42am UTC](https://www.ruby-forum.com/t/engine-best-practices/111333/2 "2007-08-06T11:42:40Z")

</div>

On Aug 6, 4:03 am, snacktime [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Say you have a decent sized engine. Before too  
> long you take the chance of creating naming conflicts with the app  
> that uses your engine.

The best use-case for taking advantage of the engines plugin is when  
you are sharing focused pieces of functionality:

a) that you have written yourself  
b) between several of your own applications.

This means that you, the developer, are entirely in control of the  
namespace in which all of this code exists, and you can then deal with  
any clashes when they occur.

In my experience, these namespace issues have never occurred; I’d  
attribute this to keeping the plugins we share relatively small (one  
controller, a couple of models) and with a clear area of  
responsibility (i.e. accounts, job processing, importing).

If you want to share larger chunks (a forum seems to be popular at the  
moment), this is going to be tricker, but reasonably careful design of  
the forum classes (yes, probably with namespacing and careful routing)  
should make this possible. The point is, if you want to share larger  
codebases with relatively certainty that there won’t be any namespace  
problems, you ought to own all the code you’re using.

- James
