TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-12-2008, 01:49 PM   #1 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 25
Thanks: 8
cosmok is on a distinguished road
Default Interface Question

Hello,

A friend of mine sent me this question and we had different views on how to approach/solve it. So, I am hoping that some of the PHP Gurus here might be able to throw some light on this:

So here it Goes:
Class Diagram

Container-----Bag
|
|
|
Luggage

Vehicle
|
|
Car ----Station Wagon
|
Sports
Basically what needs to achieved is:
Define the Vehicle interface with an abstract ‘addLuggage’ function that takes a Container as argument.
Define the Car class that initialises an array of luggage upon instantiation.
Define the Sports class with an implementation of the ‘addLuggage’ function that throws an exception if a Suitcase is passed as argument.
So, how would you approach it?
cosmok is offline  
Reply With Quote
Old 02-14-2008, 10:11 AM   #2 (permalink)
The Acquainted
 
EyeDentify's Avatar
 
Join Date: Nov 2007
Location: Sweden
Posts: 106
Thanks: 13
EyeDentify is on a distinguished road
Default

Go to the "Lost and found" ?
__________________
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.
EyeDentify is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:19 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design