Mads Andersen
Mads Andersen

Reputation: 3153

How does JDBC use abstract factory?

I got an exam in two days and one of the questions is how JDBC uses the abstract factory.

I myself am not so skilled with design patterns, so maybe somebody here has the answer.

I was thinking that maybe, DriverManager.getConnection(url) is an example of abstract factory, but am not sure. Is it an abstract factory or is it a factory method?

Upvotes: 2

Views: 4165

Answers (2)

Geo
Geo

Reputation: 8771

Your exam is probably going to be about Design Patters, so I recommend that you go ahead and study design patters in details. A good book for this is Objects, Components , Models and Patterns with ISBN 9783540698234. Please make sure to study all the patterns in detail since is mostly theory. If you need examples go to wikipedia or other sources those are very helpful to understand the theory. I am sure you will get the point if someone here points you out the answer, but what the teacher is looking is for you to understand the concept.

If this is an exam about JDBC instead, then getting the answer from here will not be a big problem. I hope you do well in your exam.

Upvotes: 0

Paul Sonier
Paul Sonier

Reputation: 39510

Obviously, the purpose of the question is for you to be able to understand the Abstract Factory Pattern, and how it is used. The best way for you to find this out is to read about it; here is the wikipedia article on the Abstract Factory Pattern.

http://en.wikipedia.org/wiki/Abstract_factory_pattern

Upvotes: 1

Related Questions