Is phpBB 3 object oriented?

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
bestweb
Registered User
Posts: 16
Joined: Wed Feb 18, 2004 7:31 pm

Is phpBB 3 object oriented?

Post by bestweb »

is phpBB3 object oriented or does it just use classes because it can? I've noticed in phpBB3 and 2 that it really only has a few things that seem to be managed by classes such as the dba, but I have never seen a real full-fleged 'embracement' per se of object orientation. There are no apparent patterns in the code and there doesn't seem to be a key framework, so is it actually object oriented?

** I've noticed that more of phpBB3 is managed by classes, but I have not delved into the code to see how it really works.

It seems to me on the implementation of the acl class (I'm not 100% sure on that acronym and I am curious as to what it stands for) that it is either one very large class that just has a bunch of member functions, or that it is one class that brings together other classes with no real interface.

Rather than being an accusation as it may seem, I would like to hear from the dev's/people who really know the code of if phpBB is object oriented.

p.s. Using classes doesn't make something object oriented.
Fet up with waiting for phpBB3?
k4 Bulletin Board version 2.0-Dev

User avatar
Viperal2
Registered User
Posts: 223
Joined: Tue Jun 08, 2004 9:28 pm
Contact:

Re: Is phpBB 3 object oriented?

Post by Viperal2 »

phpBB 3 is and will not be OO, this was mentioned a long time ago. Something being OO doesn't mean it will give you increased performance, it may well be the opposite.

Putting something into a class with no reason is stupid, and would hinder your scripts performance, If it looks the same in a class as it does outside, don't use a class.

Now with php5 you have some extra, and class performance increase, but that depends on if you know how to use it properly. Smart use of classes is currently the best why to go. As for security, unless you need some stuff private. wrapping your coing in a function would do the same thing, :lol:

Sorry not going to say when and why to use classes, but if you have a class/extent without a class variable ($this-> / CLASS:: ), between functions or extents your doing something wrong.

P.S. No one said using classes makes it an OOP :mrgreen:

Wrote this kind of fast, so don't bash my grammer :-).

Edit: change my P.S. what I really wanted to say. :oops:
Last edited by Viperal2 on Thu Jun 23, 2005 12:40 am, edited 5 times in total.
What is The Viperal ?

http://developer.berlios.de/projects/viperals/" target="_blank

bestweb
Registered User
Posts: 16
Joined: Wed Feb 18, 2004 7:31 pm

Re: Is phpBB 3 object oriented?

Post by bestweb »

Don't worry, I have a pretty good grasp on PHP and OOP. The reason why I don't look into phpBB's code more indepthly is because I don't want to develop 'bad' coding standards. I'm not saying phpBB's code is bad, but if I start to look a lot at phpBB's code, I will start to do things in a similar way and probably 'depend' on your code instead of finding my own way to program.

My main question was simply, is phpBB OO and if so, does it take advantage of what it can do.

Thank's for answering my question. :D
Fet up with waiting for phpBB3?
k4 Bulletin Board version 2.0-Dev

User avatar
Viperal2
Registered User
Posts: 223
Joined: Tue Jun 08, 2004 9:28 pm
Contact:

Re: Is phpBB 3 object oriented?

Post by Viperal2 »

bestweb wrote: Don't worry, I have a pretty good grasp on PHP and OOP. The reason why I don't look into phpBB's code more indepthly is because I don't want to develop 'bad' coding standards. I'm not saying phpBB's code is bad, but if I start to look a lot at phpBB's code, I will start to do things in a similar way and probably 'depend' on your code instead of finding my own way to program.

My main question was simply, is phpBB OO and if so, does it take advantage of what it can do.

Thank's for answering my question. :D
Sorry for the negative post, I'm a bit off today. :evil:

No phpbb is not OO nor was it meant to be. ;)
What is The Viperal ?

http://developer.berlios.de/projects/viperals/" target="_blank

Graham
Registered User
Posts: 1304
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK

Re: Is phpBB 3 object oriented?

Post by Graham »

The best way of describing it, is that phpBB uses classes where it is appropriate to do so for things like the DBAL or the module system.

However, OO code is not the solution to everything that some people make it out to be, so in some places it is not suitable to use it and better to use normal code.

The end result is that the code both is and is not OO :)
"So Long, and Thanks for All the Fish"

Graham
Eeek, a blog!

blobber
Registered User
Posts: 96
Joined: Wed Mar 16, 2005 6:28 pm

Re: Is phpBB 3 object oriented?

Post by blobber »

bestweb wrote: Don't worry, I have a pretty good grasp on PHP and OOP. The reason why I don't look into phpBB's code more indepthly is because I don't want to develop 'bad' coding standards. I'm not saying phpBB's code is bad, but if I start to look a lot at phpBB's code, I will start to do things in a similar way and probably 'depend' on your code instead of finding my own way to program.
So far, this is indeed by far the most creative excuse for not actually looking into phpBB's source code ... :lol:

(IMNHSO, if you really did have "a pretty good grasp on PHP and OOP" you would be very unlikely to "develop 'bad' coding standards' at all, only by looking at others' source code. Because, you would most likely already have developed something that I would refer to as "pattern thinking", this would put you in the position to actually deal with pretty much most sorts of high- and low-quality sources, without having to be afraid to somehow get "infected" by a programmer's source code who doesn't have developed the same level of "grasp" that you pretend to possess. )

User avatar
the_dan
Registered User
Posts: 700
Joined: Thu Apr 01, 2004 7:36 pm

Re: Is phpBB 3 object oriented?

Post by the_dan »

bestweb wrote: Don't worry, I have a pretty good grasp on PHP and OOP. The reason why I don't look into phpBB's code more indepthly is because I don't want to develop 'bad' coding standards. I'm not saying phpBB's code is bad, but if I start to look a lot at phpBB's code, I will start to do things in a similar way and probably 'depend' on your code instead of finding my own way to program.

My main question was simply, is phpBB OO and if so, does it take advantage of what it can do.

Thank's for answering my question. :D
To the contary - Looking at other peoples code is the best way to improve your own. I've seen things I've been doing hideously inneficiantly done a lot better in code written by others, and I've learned from it. If you're as good a coder as you say you are, you'll be able to spot the bad coding habits, and do it better yourself. Looking at others code is an invaluble way to learn.

As far as I can tell, phpBB uses OOP where it provides benafits, and then procedural code where OOP would be inneficiant and unecassary.

q3utom
Registered User
Posts: 172
Joined: Sun Aug 10, 2003 8:53 pm
Location: folkestone, kent, uk
Contact:

Re: Is phpBB 3 object oriented?

Post by q3utom »

When would it be appropriate to use OOP in phpbb?

bestweb
Registered User
Posts: 16
Joined: Wed Feb 18, 2004 7:31 pm

Re: Is phpBB 3 object oriented?

Post by bestweb »

I didn't mean to give the impression that I am an excellent coder, because I am not, the real thing is that I have been developing forum softwares for the past few years. I generally find the best way to learn (for me) is to look t a small contained batch of code, such as what you might find on a tutorial or an example of a good way to go about doing things.

I have looked into the source code of phpBB, IPB and vB, but the main reason is I want to find out how you do things so efficiently. Hey, I'm contradicting myself. In doing that type of thing, I saw vB used iif() in the same way mIRC used if and I got into the mentality that "if vB or phpBB do it, then it must be a good way!"

Yes I would be *honoured* to have the most creative excuse to not look in your code :P I do however, look in places, for example I wanted to figure out what makes your session class work so much better than ones I've used/made. I've never actually found my answers because some of the systems I use are too different, but it has given me ideas on how to approach future ones.

generally, I think I struck the wrong tone at the start of this topic, so I appologize. I did not mean to say that phpBB SHOULD be taking advantage of OO everywhere, because that wouldn't work. I was just curious about the way you've weaved it in and around your code.

And please, what does "acl" stand for???
Fet up with waiting for phpBB3?
k4 Bulletin Board version 2.0-Dev

Martin Blank
Registered User
Posts: 687
Joined: Sun May 11, 2003 11:17 am

Re: Is phpBB 3 object oriented?

Post by Martin Blank »

Access Control List, if it's what I think you're talking about. It's the security apparatus that decides whether you have access to specific functions or features.
You can never go home again... but I guess you can shop there.

Post Reply