Jump to content

Simple OOP System Examples


Dave Tarmac

Recommended Posts

I'm looking for any guides/tutorials on building a simple system/application using OO methods.

 

I'm new to OOP and after reading lots of 'What is OOP?' examples, I get the jist of what a class, method and property is and I get how to call them, creating an instance and manipulating that.

 

What I don't get is how sever classes can work together to form a functioning system. I've done a fair amount of Googling on the subject, but I can't seem to find a tutorial on building a simple system (for example a simple inventory system to manage DVD's or something) to show how they work in a real world situation (including database creation).

 

If anyone knows any websites that do such a thing, or can offer advice, or even point me in the direction of a book that might do such a thing then could you please share this information as I am actually tearing my hair out.

 

Many thanks.

Link to comment
Share on other sites

You want an inventory system in PHP...

 

Have you defined what functionality this system is going to perform? Write that out for us and we'll get you rolling.

e.g.

1) Users can find a DVD based by category or title.

2) Admins can insert new DVDs into the database

3) A DVD has a title, product_id number, and a small description.

etc. etc.

Link to comment
Share on other sites

I did actually only choose the inventory example because I thought that it would be a good example usage of OOP methods.

 

But if you want, we can sort it out for an example.

 

Basically, a user (registered) can view any DVD's in the catalogue.

Only Admin can add new titles in to the DB

 

DVD ((id), title, description);

 

The reason I ask about a real world example is that I need to build a pack & pick warehouse system and I haven't really any clue where to start using OOP methodology.

 

If anyone has any ideas about this, then feel free to chime in.

 

Cheers.

Link to comment
Share on other sites

Probably a good place to start would be with identifying your processes.

 

an example one:

1) User picks product -> product is added to basket -> product is taken from inventory -> inventory stock is reduced by 1

2) User selects checkout -> is presented with goods and total price (+ extras)

3) User completes information -> systems stores information

4) User completes credit card details -> system authenticates card information

5) System authorises completed transaction -> makes inventory reduction permanent

6) System sends product orders + details to product acquisition (i.e. people that get the product)

7) People print out customer details

8) People package product into box and shove in the van... (processes beyond this are human...)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.