# Proper way of organizing code into subpackages

**URL:** <https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835>\
**Category:** New to Julia\
**Tags:** packages, code-organization\
**Created:** [January 4, 2021, 5:34pm UTC](https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835 "2021-01-04T17:34:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [January 4, 2021, 6:58pm UTC](https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835/5 "2021-01-04T18:58:17Z")

</div>

### Understanding modules

Here are a few threads you might want to read:

- [[ANN] PatModules.jl: a better module system for Julia - #57 by MA\_Laforge](https://discourse.julialang.org/t/ann-patmodules-jl-a-better-module-system-for-julia/52226/57)
- The post immediately below that one.
- [Defining multiple modules in a package](https://discourse.julialang.org/t/defining-multiple-modules-in-a-package/52702) (I provide explanations here too)
- [Dependencies of src files inside a package](https://discourse.julialang.org/t/dependencies-of-src-files-inside-a-package/43144) (and here)

### Multi-package repositories

If you truly are going to write multi-package repositories, you might want to look at the following:

- [add subdir functionality by KristofferC · Pull Request #1422 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1422)
- [Feature request: Store multiple registered packages in a single Git repository · Issue #1251 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/1251)
- [Feature request: scan subdirs for updated versions/projects · Issue #1874 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/1874)
- [Proposal for allowing packages to opt-into `import A.B` only loading `B` without loading `A`. · Issue #2005 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/2005)

I would guide you on how to use them, but I don’t find the current solution practical (maybe I just don’t understand well enough how to use it).

---

_[View the full topic](https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835)._
