# Import struct from other module as a parameter

**URL:** <https://discourse.julialang.org/t/import-struct-from-other-module-as-a-parameter/56080>\
**Category:** New to Julia\
**Created:** [February 26, 2021, 11:12am UTC](https://discourse.julialang.org/t/import-struct-from-other-module-as-a-parameter/56080 "2021-02-26T11:12:56Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![akhil\_teja](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/akhil_teja/32/15235_2.png) [@akhil\_teja](https://discourse.julialang.org/u/akhil_teja)\
**Post date:** [February 26, 2021, 2:34pm UTC](https://discourse.julialang.org/t/import-struct-from-other-module-as-a-parameter/56080/6 "2021-02-26T14:34:20Z")

</div>

Thanks for the response.

I have went through the post you wrote, but still I don’t get this from a user experience point:

If I’m a maintainer of the repo I do understand that src/A.jl is included in main namespace and I can define my parameters without an explicit import.

But for the first time viewer don’t you think this would be a nightmare to understand that **AbstractA** is a part of main namespace.

Ref Link:

> [@Best practice for managing package hierarchy](https://discourse.julialang.org/t/best-practice-for-managing-package-hierarchy/55822/5):
>
> ok, like you I would have src/MyPackage.jl, then module MyPackage abstract type AbstractA end include("A.jl") include("B.jl") ... export AbstractA, my\_func, my\_other\_func end src/A.jl does not need to be another module, just gets included into MyPackage. Since AbstractA was declared before A.jl got included, you can use it: # src/A.jl function my\_func(a::AbstractA) # do something end the same goes for src/B.jl (you don’t need another module): # src/B.jl function my\_other\_func…

---

_[View the full topic](https://discourse.julialang.org/t/import-struct-from-other-module-as-a-parameter/56080)._
