Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OOP Project Structure

    Hi everyone,

    I have just started learning OOP and I am looking for some help/advice.

    To help learn I am going to create an event booking system. I have the most of this working using standard PHP but since I am learning OOP thought it might be good to convert it.

    Ok so to start, I am planning to create the 4 individual classes below:

    Events (Event name, date, location)
    EventTickets (Ticket type, price & qty)
    EventBookings (booking name, email, telephone)
    EventPayments (Card type, number and expiry date)

    Q1. Should I create 4 classes like above or structure it different?
    Q2. How should I set up Inheritance?
    Q3. This might answer the above two questions but how would you start this project?

    I am looking for any advice on creating this project. I will share my progress as I go along and hopefully help anyone else who is new to OOP.

    Thanks in Advance
    Robert
    Last edited by robertfyffe; 10-08-2010 at 01:42 AM. Reason: Spelling mistake

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What would each class do? I know you kind of told us but how much work would each class be doing? You could even just make one class and use the functions in there but it might be easier to understand with multiple classes. Whatever you do, make a backup of what you already have so if something breaks you can go back to what works. What are you going to do to manage your database? I would use OO for that as well. I think there is a decent mysql class in the Post a PHP Snippet subforum.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok this is how I would like to work. User selects an event and then all the ticket types for that event will be listed along with price and quanitity available.

    So they select a ticket by choosing a quantity on it and then click next which will bring them to a page to fill out there personnel details and payment details.

    The booking part will work something like how this one works:

    http://www.seetickets.com/Event/ERIC...-E-C-C-/501472

    So I need to relate each column in a row to grab the information selected.

    So I suppose the main components would be:

    1. Grab selected ticket choice
    2. Store in Database


    As for the functions I thought:

    Events (Process event chosen and return)
    EventTickets (Process ticket type chosen and return)
    EventBookings (Process bookings and store in MySQL)
    EventPayments (Process Payment and store in MySQL. These will erased within a few hours once processed.)

    Maybe this is to much. What do you think?

    Thanks
    Robert

  • #4
    New Coder
    Join Date
    Oct 2010
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any more advice for me?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •