简体   繁体   中英

How to organize a large java project in Intellij Idea

I know this quesiton is a bit general, but I can't seem to find a good summary of the thinking behind the optimal way to break up a large project in IDEA.

My project consists of several components --

A grails service running on EC2 A grails server hosting an admin website. A grails server hosting a customer facing website An android client app

Several custom built middleware libraries for managing interaction with a DynamoDB backend on Amazon.

The middleware libraries are intended to be used by several of these componenets (including the Android Ap). One o fthem is specifically to serve as a data layer by which the various ocmponenets access data on the Amazon DynamoDB backend.

What is the intended way that all of these components should be organized into projects in IDEA? Should the middleware be built as a sperate project? How should they be imported in to each of the componenets? As "global libraries", copied source files or what?

Should the "admin website" be built as a separate package within the same project as where the Grails service or the Android application lives?

What is the thinking behind the IDEA "project Structure" and the various sections (facets/modules/libraries/SDKs etc is all a bit opaque to me, but somehow seems to me especially in the Android application I need to be careful not be loading up a ton of code I don't really need or duplicating a lot of the code so that maintenance of the middleware painful.

Any general guidance on these topics would be appreciated, or pointers to good reference material on the topic.

Each component should be organized as a separate module in Intellij IDEA. One modules can use others as dependencies.

There are several options for connecting libraries:

  1. Add jars as global libraries in "Project structure" section in project properties. Then add that library to every module using it.

  2. Add jars as exported dependencies for a new module, and then add that module as dependency to others . Advantage of this approach is that you localize external dependencies within a single module, that can help you to make maintaining dependencies easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM