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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:31:44+00:00 2026-06-11T02:31:44+00:00

I started learning design patterns a while ago (only covered facade and abstract so

  • 0

I started learning design patterns a while ago (only covered facade and abstract so far, but am enjoying it). I’m looking to apply the Abstract pattern to a problem I have. The problem is: Supporting various Database systems using one abstract class and a set of methods and properties, which then the underlying concrete classes (inheriting from abstract class) would be implementing.

I have created a DatabaseWrapper abstract class and have create SqlClientData and MSAccessData concrete class that inherit from the DatabaseWrapper.

However, I’m still a bit confused about how the pattern goes as far as implementing these classes on the Client.

Would I do the following?:

DatabaseWrapper sqlClient = new SqlClientData(connectionString);

This is what I saw in an example, but that is not what I’m looking for because I want to encapsulate the concrete classes; I only want the Client to use the abstract class. This is so I can support for more database systems in the future with minimal changes to the Client, and creating a new concrete class for the implementations.

I’m still learning, so there might be a lot of things wrong here. Please tell me how I can encapsulate all the concrete classes, and if there is anything wrong with my approach.

Many Thanks!

PS: I’m very excited to get into software architecture, but still am a beginner, so take it easy on me. 🙂

  • 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-06-11T02:31:46+00:00Added an answer on June 11, 2026 at 2:31 am

    It could look something like this:

    DatabaseWrapper dbClient = DBFactory.getInstance(DbType.SQL, connectionString);
    

    Almost all design patters just introduce another layer of indirection and/or abstraction. In this case DBFactory is an abstraction layer that selects an appropriate implementation based on DbType enum.

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

Sidebar

Related Questions

I started learning JavaScript a while ago. It's a fairly easy programming language considering
I started learning Delphi two days ago but I got stuck. I broke down
I started learning Rails 6 months ago and so far I love the community
I recently started learning test-driven development but I always see myself changing the design
I have only started learning python recently. I would still be considered a beginner.
I started learning rails a few days ago and I'm reading head first rails
I am learning Web Design by myself and now I've started playing with twitter
Started learning java a week ago and also decided learning the right way to
I started learning C++, classes, objects, structures and more, but I'm having some problems
I just started learning about domain driven design, and one of the few things

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.