Page 1 of 1

SQL Abstract Layer

Posted: Sat Jan 21, 2006 3:45 am
by pilau
I've read about it twice in this forum, and I thought that a definition would be nice.

Posted: Sat Jan 21, 2006 4:11 am
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.

Posted: Sat Jan 21, 2006 11:18 am
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.

Posted: Sat Jan 21, 2006 5:09 pm
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.

Posted: Sat Jan 21, 2006 8:16 pm
by AKA Panama Jack
feyd wrote:An example of a widely used abstraction layer is ADOdb.
Or...

Points to signature below. :mrgreen: