1

Perhaps a strange question, but what exactly is the difference/similarity between a Wrapper and a Database Abstraction Layer (DAL) for MySQLi or PDO? I can't find much information about them on the internet. I was looking for a script that includes the query's, prepared statements, eg., should I use a wrapper or DAL for that? And when should I use the other one?

Thanks!

Jordy
  • 4,719
  • 11
  • 47
  • 81
  • a wrapper generally provides an alternative api to a component/subsystem whereas an abstraction layer provides a consistent interface to a group of similar components/subsystems. – Orangepill Jul 21 '13 at 20:55
  • Oké thanks. But for exampe: http://www.google.nl/search?client=aff-maxthon-maxthon4&channel=t8&q=mysqli+wapper, the first 4 examples are DAL's, not wrappers isn't it? – Jordy Jul 21 '13 at 21:08

1 Answers1

1

Wrapper is something you write around another library for your purposes.

Take a look at this question:

Good PHP ORM Library?

There are lot of alternatives, depending on what framework you are using, most of them have their own wrappers for this purpose.

Doctrine is pretty popular.

You can also use Zend Framework and it's data access for that purpose as well.

Pear has stable data access wrappers.

Community
  • 1
  • 1
DarthVader
  • 52,984
  • 76
  • 209
  • 300
  • Thanks, but when should I use a wrapper and when a DAL? I don't get it:P – Jordy Jul 21 '13 at 20:53
  • If you dont need any specific requirements for you data access, dont use a wrapper. For examples, if you need to integrate caching in your app, create a wrapper for your data access that has cache and data access. hope this is more clear – DarthVader Jul 21 '13 at 20:55
  • Oké thanks. But for exampe: http://www.google.nl/search?client=aff-maxthon-maxthon4&channel=t8&q=mysqli+wapper, the first 4 examples are DAL's, not wrappers isn't it? – Jordy Jul 21 '13 at 21:08