Jump to content

What classes should I use in my project? What else should I know about OOP?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
G33k

G33k

    Newbie

  • Members
  • PipPip
  • 19 posts
I am willing to create my own forum or something similar, where one player can ask question or give suggestions and so on. And other players could vote for the question and of course answer to that.

I am able to do that in PHP procedural programming, but I started studying Object Oriented Programming and I know all basics and now I am very keen to do something useful and something bigger in OOP to improve my knowledge.

So, maybe you could give me advices on what classes should I use and maybe something else for a OOP novice. Do not offer me use framework, because first of all I want to create everything by myself. Thank you.

#2
dbug

dbug

    Programmer

  • Members
  • PipPipPipPip
  • 155 posts
If you want to do this in PHP, the first thing you should do is to know the characteristics of OOP in PHP. The online manual is quite good and has some examples. There are a few special things you must know before writing classes and using objects in PHP.

There exists a module for PHP called SPL (Standard PHP Library) that offers some classes and interfaces you might find useful. There are some other classes implemented by other extensions (for example to manipulate XML data).

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
An MVC (model-view-controller) framework pattern would most definitely suit your forum task, and help you learn the inner guts of (objects) in PHP.
Model View Controller [Web Application Component Toolkit]
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
At this stage, you may not even be ready to answer that question. You'll also need to consider how your database will interact with the classes you design, along with how they'll produce output.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
PETTE

PETTE

    Learning Programmer

  • Members
  • PipPipPip
  • 50 posts
You really need to find a good tutorial on OOP. You should try php.net. Why don't you get a whole book and learn PHP. It sounds like you're learning PHP unguided this could take a long time. Find a book that covers every thing.