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

  • Home
  • SEARCH
  • 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 6334745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:43:11+00:00 2026-05-24T18:43:11+00:00

There is a third-party application, which database is accessed by my application. It’s database

  • 0

There is a third-party application, which database is accessed by my application. It’s database schema had been changed several times, so, there are about four different database schemas right now (different columns, different select conditions for the same entities).

For example, there is an entity “Application”. For different schemas it could be retrieved by:

1)SELECT * FROM apps WHERE cell_number < 65535 AND page_number < 65535 AND top_number = 65535

2)SELECT * FROM menu_item WHERE cell_number > -1 AND page_number > -1 AND parent_id = -1 AND component_name IS NOT NULL

And so on…

So, what design pattern (in Java) would be more comfortable to support multiple database schemas of different versions of the same application? It should be ready for future changes, of course.

  • 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-24T18:43:11+00:00Added an answer on May 24, 2026 at 6:43 pm

    It’s not an easy task because is difficult to proper map a table structure to an object (nowadays an ORM is often used to perform this task).

    From your question seems that declaring Application as an abstract class or interface and provide different implementation is enough.

    public abstract class Application(){
        public abstract Application getAnApplication();
    }
    
    public ConcreteApplicationOne(){
        public Application getAnApplication(){
    
          //retrieve application data from database scheama 1 , build object and return it.
        }
    }
    
    public ConcreteApplicationTwo(){
        public Application getAnApplication(){
    
          //retrieve application data from database scheama 2 , build object and return it.
        }
    }
    

    And using some sort of factory to build give to the user the right concrete Application class:

    public class factory{
    public Application getApplicationImplementation(){
    if (cond1){
    return new ConcreteApplicationOne();
    }else {
    return new ConcreteApplicationTwo();
    }
    }
    }

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

Sidebar

Related Questions

I am developing an iPhone application which will install few third party applications in
I am using a third party database. A host application runs the database, and
I am writing a DLL which is loaded by a third party application (The
I have a third party .Net web application (Sitecore) which connects to an Oracle
is there any chance, that (after mango is released) the third-party WP7 application can
Are there any third-party Templating Engines for Asp.net like we have smarty,savant for php
Is there a third party tool or something similar that will allow users to
Apart from Sql server profiler ,is there any third party user friendly tool available
I use C#, IIS, ASP.NET, SQL Server. Is there a third-party platform I can
I was wondering if there is a tool (automator script or a third party)

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.