Search code examples
directory-structureconventions

What is the "Common" folder used for in software files?


After looking through software files, I often came across a folder named "Common".

I suspect this is only used for convention and can be used however the developers desire, but what data is generally stored within this file? When would and wouldn't I use a folder named "Common"?

The directory C:\Program Files\Common Files on Windows contains files which are used among several different applications, is the "Common" file I'm referring to used in this manner?


Solution

  • A typical use might be part of a modular application, where the user can choose to install one or more optional modules (or plug-ins). These then get loaded at runtime by the application.

    Any files provided by this application for use by the modules (APIs, libraries, frameworks, shared resources etc) would then be found in a 'Common' folder. This is the case with the C:\Program Files\Common Files folder.

    This is useful to module authors, as they then know a reliable location to find their dependencies without having to include them in the module, unnecessarily increasing module size.

    This idea can also be extended to similar architectures, e.g. multiple versions of an application with files shared by all versions in a 'Common' folder.

    This brings disadvantages too; versioning becomes more complicated as upgrades to the application could also lead to the shared files being updated and becoming incompatible with the installed modules. Old file versions must then be retained in case an old module is still installed.

    The meaning of 'Common' here is 'shared' ("something in common") rather than 'frequent' ("commonly seen").