Why use OOP?


Posted on 16th Feb 2014 07:03 pm by admin

Can someone explain to me why I should use OOP instead of procedure based code.

Im building a shopping cart and i created and Item object already and using it to hold data for each item. But this Object just has properties. I mean what methods could there possibly be for an item.

Did you know?Explore Trending and Topic pages for more stories like this.
Why would I need a Cart object either? There will never be more than 1 instance of the cart running. So what are the advantages to putting all my functions inside of a class?

Thanks, and sorry if your offended by this, im trying to go OOP i just don't see why yet.
No comments posted yet

Your Answer:

Login to answer
217 Like 8 Dislike
Previous forums Next forums
Other forums

Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a design

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

Keeping data in form
How can I keep whatever I write in the form?

Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:wampwwwlogspagesme

Send current URL in URL with a $_GET variable problem.
Hello community,

I have created a function that gets the current variable of a page, example:

unserialize help, getting errors
hi all ,
I got a form with 6 fields (2 input and 4 select box), when the page loads one block is

php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecu

How to return to a previous page after running a PHP script
I'm having a bit of a melt down here because I think this should be really easy but can't work it ou

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash