Page 1 of 2

My First step to create a class, how 2 start and from where

Posted: Wed Aug 03, 2005 7:13 am
by vsaggu
Helo every1 in dev network,

i want to konw how i should start to work on classes from the basic. imean from where exactly to start ...

i hope u al in this network wil not disappoint me.

i need ur support plz

thnx

Posted: Wed Aug 03, 2005 5:26 pm
by feyd
Have a look in the OOP and classes discussion from the Theory and Design forum (above)

Posted: Thu Aug 04, 2005 12:48 pm
by vsaggu
no, i hvent. u know what. i hve understood the basic of classes and oops. but the thing is how to implement in real code. like first i want to start wth normal functions and then mysql connections

Posted: Thu Aug 04, 2005 1:00 pm
by patrikG
vsaggu wrote:no, i hvent. <span style='color:blue' title='ignorance is bliss'>you</span> know what. i hve understood the basic of classes and oops. but the thing is how to implement in real code. like first i want to start wth normal functions and then mysql connections
If you had read up and understood the basics of classes and OOP, you would know about functions. I suggest buying a copy of Harry Fueck's PHP Anthology which will give you all the background you need to get going.

Posted: Thu Aug 04, 2005 1:31 pm
by theda
Have you learned how to speak proper English first? That's pretty much a prerequisite to programming.

Posted: Thu Aug 04, 2005 1:35 pm
by patrikG
no need to get personal, theda.

Posted: Thu Aug 04, 2005 3:25 pm
by shiznatix
i would first create a class to handle a mysql connection, its quite easy and should give you a good idea how to use classes. then you can add on handling querys and whatnor

Posted: Thu Aug 04, 2005 9:04 pm
by timvw
I would start using ADOdb..

And then write a class that is able to generate SQL.. (For example, an SQL query has a couple of clauses.. Having can only be used when GroupBy exists.. Might be a nice exercise to train relationships/dependencies etc ;))

Posted: Fri Aug 05, 2005 1:23 am
by s.dot
I've never tried to use a class, or even understood why I would need to. I guess I should get on the ball, eh.

Posted: Fri Aug 05, 2005 7:44 am
by BDKR
scrotaye wrote:I've never tried to use a class, or even understood why I would need to. I guess I should get on the ball, eh.
You'll get there.

My book recommendation is "Introduction to Object Oriented Programming" by Timothy Budd.

As for need, Object Oriented Design or Responsibility Driven Design helps one visualize a complex system into component parts each having it's own area of responsibility or function if you prefer. When a complex system is envisioned and created in this manner, it's easier to design, maintain, and extend. Furthermore, the components lend themselves to use in other systems as they (ideally) should be as stand alone as possible.

Hope that helps. :wink:

Cheers,
BDKR

hey

Posted: Fri Aug 05, 2005 1:04 pm
by vsaggu
whats the matter with u theda, and thnx patrikG. i wil try to find this book first.

Posted: Fri Aug 05, 2005 2:04 pm
by Luke
I learned by doing, and I learned to do, by reading. Here is a great book...

PHP5 and MySQL Bible... which can be found on Amazon...

http://www.amazon.com/exec/obidos/tg/de ... s&n=507846

Posted: Fri Aug 05, 2005 2:14 pm
by infolock
I have a few good links on my website you might find interesting.

http://www.jonhibbard.com/link/view.php ... n=phplinks


The OOP links are located near the bottom...

Posted: Fri Aug 05, 2005 2:48 pm
by theda
I can't stand horrendous grammar and 'net speak.

Posted: Fri Aug 05, 2005 3:44 pm
by BDKR
One armed space goat wrote: I learned by doing, and I learned to do, by reading. Here is a great book...
I think the PHP engine calls that a circular reference. :D
Err... or at the very least, you're saying you learned to do by reading.