How would you handle such situation?
How would you handle such situation?
- Subject: How would you handle such situation?
- From: Dev WO <email@hidden>
- Date: Wed, 3 Aug 2005 18:58:35 +0200
Hi list,
After trying to figure out the best way to handle the following, I
came up with... nothing.
I have a parent class Product and subclasses
-ProductTypeA
-ProductTypeB
and a couple more types;)
I'd like to display the informations (the shared one (from Product)
like "price", and the specific to a type ones, lets say "speed") of
the product.
I was first thinking about doing a template for each type of product,
but this isn't really good as I would have to update every template
whenever I update one.
So I was thinking about creating one template that would get all the
attributes (with conditionals) and create instance variables for
every attributes and conditionals inside the template component.
Then I wanted to do something like: (pseudo code;))
if object instanceof ProductType1 then
cast object to productType1 variable
set all the attributes and conditionals
I think it could work, but I'm not really sure I'm going the right
direction...
So many times people of the list showed me a lot more simpler and
efficient way to go, so maybe this time again.
Anyone with a point of view?
Thanks
Xavier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden