Re: [PHP] PDO: extend or encapsulate?

2012-07-15 Thread shiplu
From OOP point of view. Use encapsulation: When a class has a has-a relation-ship with other class you should use encapsulation. For example, If MyDB is a class that has-a pdo driver in it, then PDO will be encapsulated inside MyDB class. This is also called containment. MyDB should contain PDO.

Re: [PHP] PDO: extend or encapsulate?

2012-07-15 Thread tamouse mailing lists
On Sun, Jul 15, 2012 at 5:50 AM, shiplu shiplu@gmail.com wrote: From OOP point of view. Use encapsulation: When a class has a has-a relation-ship with other class you should use encapsulation. For example, If MyDB is a class that has-a pdo driver in it, then PDO will be encapsulated

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread tamouse mailing lists
On Sat, Jul 14, 2012 at 12:04 AM, Paul M Foster pa...@quillandmouse.com wrote: On Fri, Jul 13, 2012 at 12:06:22AM -0500, tamouse mailing lists wrote: It's Friday, so... Yes, it's true, I have just started looking at using PDO instead of mysqli -- a bit behind the times... My question at

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Tony Marston
wrote in message news:1535031289.371987.1342162338279.javamail.open-xcha...@email.1und1.de... tamouse mailing lists tamouse.li...@gmail.com hat am 13. Juli 2012 um 07:06 geschrieben: It's Friday, so... Yes, it's true, I have just started looking at using PDO instead of mysqli -- a bit

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Lester Caine
tamouse mailing lists wrote: I am rather agreeing with both of you. Back in the days I used to poke at Java, one of the caveats was to only inherit from abstract classes, and encapsulate final classes. It does make more sense to me that way. One option is to keep both drivers available ...

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Marco Behnke
Am 14.07.12 10:09, schrieb Tony Marston: wrote in message news:1535031289.371987.1342162338279.javamail.open-xcha...@email.1und1.de... tamouse mailing lists tamouse.li...@gmail.com hat am 13. Juli 2012 um 07:06 geschrieben: It's Friday, so... Yes, it's true, I have just started

Re: [PHP] PDO: extend or encapsulate?

2012-07-13 Thread ma...@behnke.biz
tamouse mailing lists tamouse.li...@gmail.com hat am 13. Juli 2012 um 07:06 geschrieben: It's Friday, so... Yes, it's true, I have just started looking at using PDO instead of mysqli -- a bit behind the times... My question at this stage, is do people tend to extend the PDO class for

Re: [PHP] PDO: extend or encapsulate?

2012-07-13 Thread Paul M Foster
On Fri, Jul 13, 2012 at 12:06:22AM -0500, tamouse mailing lists wrote: It's Friday, so... Yes, it's true, I have just started looking at using PDO instead of mysqli -- a bit behind the times... My question at this stage, is do people tend to extend the PDO class for their own use, or