SQL Abstract Layer

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

SQL Abstract Layer

Post by pilau »

I've read about it twice in this forum, and I thought that a definition would be nice.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Abstraction layers are used to create a unified interface to something. They allow the underlying code to radically change without affecting how they are called. This is especially helpful when you need to support multiple libraries that perform similar actions. In this case, you could have an abstraction layer for MySQL, MySQLi, PostgreSQL, SQLite. An example of a widely used abstraction layer is ADOdb.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think there are two related concepts in which there is some overlap. A general abstraction layer does what it say: provides some (hopefully) better, clearer, or more appropriate interface to a lower layer. This same concept can be applied to portablity layers like the database example given. Portablity layers often use abstraction, but most abstraction layers are not for portablity. Abstraction is the more general concept.
(#10850)
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

[quote='aborint']
Abstraction is the more general concept.
[/quote]

It means hiding the internal implementation of any operation.
It might be a database access or accessing of resources across different networks or access to different file systems.
It's a basic OO property which says a class method does not make the implementation logic visible to the user, the user passes in input and gets output,,,he does not know how it is processed.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

feyd wrote:An example of a widely used abstraction layer is ADOdb.
Or...

Points to signature below. :mrgreen:
Post Reply