OZONE Asylum
Forums
DHTML/Javascript
complex switch case
This page's ID:
27696
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
TP, does PHP actually have actual interfaces? I thought the PHP5 approach was, "well, we gave you class inheritance... shut up and be happy". [quote] [b]Tyberius Prime said:[/b] Polymorphism basically means 'having different objects and treating them the same'...so no matter wether you have a bike, a car or a truck, all you say is $aVehicle->MoveTo ( $aLocation ) ;and it's the object's responsibility to handle the actual details.Whenever you have a switch statement twice, especially if you want to 'combine some, but still to seperat things depending on what it is'you're a pretty good canidate for an interface plus maybe an class inheritance strategy.Why in the world do you switch on weird numbers anyhow? Or is that just your example? [/quote]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »