PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old May 11th, 2008, 04:24 PM
ahmeds_link ahmeds_link is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Egypt
Posts: 24 ahmeds_link User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 26 m 13 sec
Reputation Power: 0
Send a message via MSN to ahmeds_link Send a message via Yahoo to ahmeds_link
Facebook
OOP way in php programming (Not introduction)

Hi all,

i read about OOP and know it's benefits but i don't know how to start using it in my applications ,

Can experts here help beginners to start applying OOP principles (such as in an example) .....

Thanks for all

Reply With Quote
  #2  
Old May 11th, 2008, 04:35 PM
ryon420's Avatar
ryon420 ryon420 is offline
Oscar Wilde addict
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2006
Location: Was lost, then found, now lost again.
Posts: 2,789 ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)ryon420 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Week 23 h 1 m 41 sec
Reputation Power: 859
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
I use OOP when and only when I have to do one process many times. For instance, in my library I have a Query class that runs queries (usually MySQL or PostgreSQL, and I have a configuration to tell it which one), debugs queries, returns number of rows/an array or rows returned from the query, logs errors and returns a nice smiley face to the user, cleans data, et cetera. Sure, you can put all your stuff into a class and that will be OOP, but not good OOP and that is what you should aim for when using OOP, or any code for that matter.
__________________

Warning, the post above may contain extreme sarcasm, crude language, and code that may confuse amateurs and professionals.


Helpful stuff: Google your question first | Read the rules | How to ask a question | Read the [PHP] manual, it is good for you
Proud supporter of: Philosophorum - "where even the trolls are smart" | Chikyu Hakken - digging for trolls
"Programmers usually hate stupid people. But the ironic thing is we spend most of our career developing programs which the stupid people will use" -- Me.


Reply With Quote
  #3  
Old May 11th, 2008, 10:02 PM
ahmeds_link ahmeds_link is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Egypt
Posts: 24 ahmeds_link User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 26 m 13 sec
Reputation Power: 0
Send a message via MSN to ahmeds_link Send a message via Yahoo to ahmeds_link
Facebook
thank you mr 'ryon420' i do an application there's a lot of forms,lot of textboxes and a lot of quaries and much repitition you said :

Quote:
'I use OOP when and only when I have to do one process many times'


so i think i need to use this way

is there any examples about ("mysql quaries class" or "forms class" for example) ?

i'll be very thankful for you

Reply With Quote
  #4  
Old May 12th, 2008, 02:47 PM
jakenoble's Avatar
jakenoble jakenoble is offline
System.out.println("eh?");
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2004
Location: Derbyshire
Posts: 859 jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level)jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level)jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level)jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level)jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level)jakenoble User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 17 h 57 m 46 sec
Reputation Power: 25
Send a message via MSN to jakenoble
Hi ahmeds and ryon420

ryon420 - interesting take on the use of OOP. Nothing about abstraction in there though? Surely that is a major benefit also.

ahmeds - for database classes try MDB2 in the PEAR library.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > OOP way in php programming (Not introduction)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway