# Organizing structs and modules

**URL:** <https://discourse.julialang.org/t/organizing-structs-and-modules/34993>\
**Category:** New to Julia\
**Created:** [February 21, 2020, 8:16pm UTC](https://discourse.julialang.org/t/organizing-structs-and-modules/34993 "2020-02-21T20:16:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [February 21, 2020, 8:32pm UTC](https://discourse.julialang.org/t/organizing-structs-and-modules/34993/2 "2020-02-21T20:32:14Z")

</div>

There are quite a few related discussions on discourse, such as [Large programs: structuring modules & include such that to increase performance and readability](https://discourse.julialang.org/t/large-programs-structuring-modules-include-such-that-to-increase-performance-and-readability/29102).

My (personal) suggestion is: unless the project is quite large, don’t use sub-modules at all. It just leads to exactly the kinds of issues that you are running into (how do I organize everything so that `A` depends on `B` but not the other way around? How do I make all types visible everywhere they need to be seen?).

Tastes differ on this question, though.

If you want sub-modules, you need one master module (probably `Orchard` in your case). Then `orchard.jl` `includes` the other modules (don’t include the same file multiple times). And if you need to see `Seed` in `Fruit` you do

```julia
module Orchard

module Seed
 ...
end
using .Seed

module Fruit
  using ..Seed
  ...
end
using .Fruit

end

```

Hope this helps.

---

_[View the full topic](https://discourse.julialang.org/t/organizing-structs-and-modules/34993)._
