Pros and cons on Hierarchical layout vs Flat layout


(Eric Chan) #1

I’m new to Gradle. I read that Gradle support hierarchical layout and flat layout on build structure. First question come to mind is which way to go for the build structure. Are there advantage choosing one over the other?

Thanks.


(Gary Hale) #2

I think the main advantage is the inherent organization that a hierarchical structure brings as opposed to a flat structure. That may not be apparent with 5 projects, but it certainly reveals itself with 100. Breaking those 100 projects up into a hierarchy makes things a lot cleaner.

On the other hand, if you have sub-projects that contain code in addition to other sub-projects, this can be problematic for some IDEs (e.g. eclipse) that won’t be happy with the nested projects.


(Eric Chan) #3

Thanks. I’m also in favor of the hierarchical structure for organization advantage.

I’m using netbeans for my IDE. Any know issue for gradle working with netbeans in nested projects?


(Gary Hale) #4

I’m not terribly experienced with netbeans, but my understanding is that it supports nested sub projects. If there are any caveats associated with that, I’m not aware of them.