Ask Your Question

Should a module ever reference a variable in another module?

asked 2014-10-02 08:31:55 -0600

claes gravatar image

Is there any valid use case for a module to reference a variable in another module? I would think that all data that a module needs should be part of the modules public API, i.e. the data should be specified as an input parameter.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-07 07:20:39 -0600

llowder gravatar image

Generally speaking, one module should/can use classes, defines, types/providers, facts, and/or functions from another modules.

When variables are used, it ties the modules together in a way that will make maintaining them much harder.

The one exception is when you have a cluster of site specific data items that are needed by a group of modules and the data items are placed into a single, common module that has the sole purpose of providing those variables.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-02 08:31:55 -0600

Seen: 120 times

Last updated: Oct 07 '14