Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 685877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:58:02+00:00 2026-05-14T01:58:02+00:00

What is considered best practice deciding how to define the set of JAR’s for

  • 0

What is considered best practice deciding how to define the set of JAR’s for a project (for example a Swing GUI)? There are many possible groupings:

  • JAR per layer (presentation, business, data)
  • JAR per (significant?) GUI panel. For significant system, this results in a large number of JAR’s, but the JAR’s are (should be) more re-usable – fine-grained granularity
  • JAR per “project” (in the sense of an IDE project); “common.jar”, “resources.jar”, “gui.jar”, etc

    I am an experienced developer; I know the mechanics of creating JAR’s, I’m just looking for wisdom on best-practice.

    Personally, I like the idea of a JAR per component (e.g. a panel), as I am mad-keen on encapsulation, and the holy-grail of re-use accross projects. I am concerned, however, that on a practical, performance level, the JVM would struggle class loading over dozens, maybe hundreds of small JAR’s. Each JAR would contain; the GUI panel code, necessary resources (i.e. not centralised) so each panel can stand alone.

    When I say “holy grail of reuse”, I say this more because it demonstrates a cleanly decoupled, encapsulated design, rather than necessarily expecting its re-use elsewhere. I consider myself a “normally intelligent” person; I consider the spagetti of intertwined nonsense I’ve had to deal with during my career slows me down 10 to 100-fold. A cleanly decoupled design allows me to deal with one concept at a time, one layer, one class.

    Does anyone have wisdom to share?

    • 1 1 Answer
    • 0 Views
    • 0 Followers
    • 0
    Share
    • Facebook
    • Report

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    1 Answer

    • Voted
    • Oldest
    • Recent
    • Random
    1. Editorial Team
      Editorial Team
      2026-05-14T01:58:02+00:00Added an answer on May 14, 2026 at 1:58 am

      I would recommend as fewer JARs as possible.

      The logic behind it, the disk storage is the cheapest commodity there available, but time spending tracing down complex dependencies is priceless.

      Hence the emergence of the .war files where all dependencies of the web application are put into a single file.

      BTW, Eclipse has a JAR exporter plugin which puts all dependent jars into a super jar and expose the entry level main method, so you can start your app with java -jar file.jar command. Although the resultant jar may be large, the flip side is not maintaining very complex class paths for you application.

      So, in your case I would go with one jar per project. If you determine that you indeed need to reuse some code in another project, just refactor it into the base project and make it a dependency in your existent project and another project.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    What is considered best practice when referring to a program's name? I've seen: #define
    What is considered best practice for animating view transitions on the iPhone? For example,
    what is considered best practice from a code readability standpoint regarding spacing? Are there
    Is there a way in Cocoa that is currently considered best practice for creating
    Would it be considered best practice to use a single template that changes it's
    It is considered best practice for encapsulation to use private fields with accessors (getters
    What's considered best practice writing OOP classes when it comes to using a property
    what is considered best practice in the following snippet: int foo(struct data *bar, struct
    I'm using VB's StringBuilder, and I was curious what is considered best practice for
    I am wondering if there are best practices for deciding between when a system

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • SEARCH

    Footer

    © 2021 The Archive Base. All Rights Reserved
    With Love by The Archive Base

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.