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 701393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:36:18+00:00 2026-05-14T03:36:18+00:00

I plan to create 3 editions of a piece of software in Java from

  • 0

I plan to create 3 editions of a piece of software in Java from existing code base. What’s the best practice? should I create 3 different projects one for each edition? Also any tools for managing editions?

  • 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-14T03:36:18+00:00Added an answer on May 14, 2026 at 3:36 am

    My first thought would be to keep a single codebase if at all possible and use some kind of flag for switching.

    If not possible, I’d try to keep as much as possible the same and have the larger project use the smaller project as a sub-project, If possible automatically enabling some features–for instance, each of the projects could have it’s own main, the different builds may just call the different mains which set flags to enable features.

    If your flags are final, it should even avoid pulling unnecessary code into your project at all.

    Finally, worst case, 3 branches in Subversion.

    Edit:

    You made me think a bit more on this and I think I found a better solution.

    I think I’d separate this into four projects, combining all the “common” stuff into a base project and the stuff that is different, I’d spread out to the other three projects–so let’s say you have base, demo, pay and business projects..

    Where the three might differ, you would have an object from one of the demo/pay/business classes provide the functionality. For instance, if the pay version has new menu items, you might have a getMenuItems in one of your objects. It would return a menu tree that you could place in your menu bar. The demo version would have less items.

    In this way your “Base” never knows which version it’s running, it just uses objects.

    To get the objects, I’d have a factory. The factory would look something like this:

    private String[] availablePackages={"business", "pay", "demo"};
    
    public getMenuClass() {
        Class c;
        for(String package : availablePackages) {
            try {
                c=Class.forName("com.meh.myapp."+package+".MenuClass");
            } catch... {
                // No package by that name
            }
            if(c != null) {
                return c.newInstance();
            }
        }
        // Something went wrong, no instance found.
    

    The updraft is that you should try to instantiate com.meh.myapp.business.MenuClass first, then try …pay.MenuClass finally …demo.MenuClass.

    This should allow you change your configuration by simply shipping different jars–If you decide to only ship the demo and main jars, you’ll get a demo app. By shipping the pay jar you’ll get the pay app.

    Note that it’s pretty likely that you’ll want business to delegate much of it’s work to “pay”, and “pay” to delegate a bunch of it’s work to “demo”, but demo knows NOTHING of business or pay, and “main” only knows of the other three reflectively.

    This would be a nice solution because there is no configuration required–in fact, you’d only have to ship the pay jar to upgrade from demo to pay, the main and demo jars are reused and stay right where they are.

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

Sidebar

Related Questions

I'm looking to create an array of byte arrays in native code. I plan
For my next project I plan to create images with text and graphics. I'm
I plan to use PyInstaller to create a stand-alone python executable. PythonInstaller comes with
We are trying to create a web-service that we plan to pass a variable
The main user-case is: Create the 2D floor plan See the 3D view of
When I try to create a new Maintenance Plan in SQL Server, I get
I plan to have 2 projects. 1. mbtech.crm.mvc 2. mbtech.crm.tests I will have a
This is in SQL Server 2008. I plan to create two tables to represent
I'm working on a toolbar type application. My current plan is to create a
I plan to create very simple custom IP-STS for SharePoint foundation 2010 without ADFS

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.