Ian,

I see what you're saying.   The way I see the object model for the  
application, I'm thinking more of what is an extension of what.    
Table Has Players, Player Has Hand, Deck Has Card, etc.

In the case of the card game, using specificity as an inheritance  
qualifier means that it would be pretty difficult for there to be any  
inheritance at all - or you would create objects that would duplicate  
functions of other objects.

A card game is essentially objects within other objects which all  
interact with one master object - the table  (or perhaps the Dealer -  
who might be the Application.cfc ;-) ).     Since the player is an  
extension of the parent object, I can set those properties on the  
request as part of my "Table" configuration through my set() methods:

table.setPlayer(variables.playerID);
table.deal(deck.getCards());
deck.drawCard(getHand());

The Table can stand empty, but the "game" happens when players  
interact with the Table as it's configured with the current Deck of  
Cards and the other Players.

For your car analogy, the same would apply:   Car Has Engine, Engine  
Has Cylinders, Cylinder has Piston, etc.   Some of those parts are  
shared in common with other cars made by the manufacturer, but it's  
the configuration of those parts in assembly that makes the car  
unique.   A Prius object would bypass the entire assembly process if  
it existed, however by assembling the correct parts through the model  
(in addition to "Prius-only" objects), you would still return a Prius.

Just my own humble interpretation of MVC with CFC's, though.   I'm  
sure there are as many ways to define your object model as there are  
cards in the deck - and I've certainly made a mis-deal or two.  :-)

Regards,

Jon

On Nov 15, 2006, at 2:19 PM, Ian Skinner wrote:

> Interesting, can you explore your reasoning for this design?  I  
> don't see the concept.  To me inheritance if to make a more  
> specific object out of a more general object.  You have a Prius  
> Object extend a car object, so that it has all the properties and  
> methods of a car plus what makes a Prius unique from other cars.
>
> I don't see how a player is a more specific type of table or deck  
> is a more specific type of table.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260614
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to