PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Oct 31, 2020 6:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Apr 26, 2005 11:00 am 
Offline
Forum Contributor

Joined: Mon Sep 09, 2002 6:42 pm
Posts: 132
Hello all..

I'm developing a ticket sales system and would like to do it using OOP.
I, as a programmer, have trouble keeping all my code in order and I think that this approch will help me tremendously. I'm looking for some experienced OOP develpers to help me with the design phase.

I have done some planning and have figured out that i'll need the following objects (feel free to recommend that I add or remove any if you see fit)

1. Venue (i.e. where the events will take place)
2. Event (i.e. The event to which the tickets will be sold)
3. Section (i.e. These sections are used to divide the venue for pricing purposes)
4. Ticket (i.e. one row per ticket. contains the location of the ticket in the venue as well as what event it is for)

There will be others but these are the ones i'm concerned about right now..

my question:
How will these related to each other?
I've had some training and leaned that Inheritance is determined by using the "is a" phrase.. and none of the objects above "are" any of the others..

How do I express that Events have tickets and sections? and that sections have tickets.. Venues will have events..or.. events will have venues.. either way i suppose..

How would you approach this?

TIA!

Will


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 11:15 am 
Offline
DevNet Master
User avatar

Joined: Thu Aug 15, 2002 5:53 am
Posts: 4235
Location: Sussex, UK
I'd recommend reading Harry Fuecks's for a good introduction to object oriented programming.

Also, will give you some deeper understanding of OOP.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 7:41 pm 
Offline
DevNet Master

Joined: Thu Jan 30, 2003 9:26 pm
Posts: 2893
Location: Glasgow, Scotland
How about something like:

Syntax: [ Download ] [ Hide ]
class BoxOffice

    {

        function BoxOffice($venue_id, $event_id, $section_id, $user_id)

        {

        }

        /*

            return (bool)

        */


        function hasSeat()

        {

            // db query

        }

        function save()

        {

            // db transaction

        }

    }



    $box_office =& new BoxOffice($venue_id, $event_id, $section_id, $user_id);

    if($box_office->hasSeat()) {

        $box_office->save();

    }


Last edited by McGruff on Sat Aug 06, 2005 6:26 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon May 02, 2005 5:58 pm 
Offline
Forum Commoner

Joined: Sat Jul 12, 2003 10:31 pm
Posts: 80
Location: London


Top
 Profile  
 
PostPosted: Tue May 03, 2005 11:00 am 
Offline
Forum Contributor

Joined: Mon Sep 09, 2002 6:42 pm
Posts: 132


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group