Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OOP in PHP

Name: Anonymous 2011-03-23 17:37

Ok, so I'm working on a project ( and yes it is for a class ) I come from a strong background in java, so this project is a bit odd to me, it being in PHP. I learned about the MySQLi interface and it makes a lot of sense to me, so what I'm trying to do is write a PHP class to do all the backend stuff for my site so that my main pages can just call $site->functionThatDoesSomething(); to get whatever needs done accomplished. the problem I'm having is with database connections. in java I'd do something like this http://pastebin.com/5Wezenk9
but since php is loosely typed I have no idea how to do that. Any tips would be appreciated, or perhaps a better guide to oop in php....

Name: Anonymous 2011-03-23 19:52

Coming from a Java is probably the worst programming background to come from, I sense you're already wanting to build a factory factory abstract factory, n-factory monstrosity of some sort. Stop writing boiler plate abstractions and just code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List