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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:48:45+00:00 2026-05-31T18:48:45+00:00

This inheritance is found in ADO.Net. Can we say that here both the design

  • 0

DbProviderFactory inheritance

This inheritance is found in ADO.Net. Can we say that here both the design patterns are being used, Abstract Factory and Factory method?

Abstract Factory: “Provide an interface for creating families of related or dependent objects without specifying their concrete classes.”

So here DbProviderFactory is an interface for creating families of related objects i.e. DbConnection, DbCommand which are all related to some database provider like Sql or Oracle provider.

Factory Method: “Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.”

So here the line (DbConnection CreateConnection()) is factory method as it defines the interface for creating objects, but let subclasses like SqlProviderFactory and OracleProviderFactory decide what instance to create. Sql provider will create SqlConnection and Oracle provider will create OracleConnection and these types inherit from DbConnection.

Can we say that each method in class DbProviderFactory is a factory method and the pattern as a whole is abstract factory?

  • 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-31T18:48:46+00:00Added an answer on May 31, 2026 at 6:48 pm

    Yes, DbProviderFactory is a good example of Abstract Factory pattern. And each CreateXXX method of this factory is a FactoryMethod.

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

Sidebar

Related Questions

I found this related question: How do I use composition with inheritance? I would
How can I do inheritance with this example. I'm trying to create an object
What i'm tring to do is this. I have a Inheritance tree that looks
I'm trying to use inheritance in JavaScript here, and I found problem having array
Was experimenting with interface inheritance and found this: interface String{} interface Object{} interface Exception{}
I am a newbie and trying to understand concepts of inheritance and design patterns.
I found this in a website while reading about virtual inheritance in c++ When
I've heard it said that it is difficult to design for inheritance, but I've
I know that Python, unlike Java, supports inheritance. But does a user class can
after experimenting with js's prototypal inheritance i've found that i'm not wild about the

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.