• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How would you handle such situation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: How would you handle such situation?
      • From: Florijan Stamenkovic <email@hidden>
    • Re: How would you handle such situation?
      • From: David LeBer <email@hidden>
  • Prev by Date: Re: Too many open files killed xServe from the net
  • Next by Date: Build & Run Issue
  • Previous by thread: Re: AW: Too many open files killed xServe from the net
  • Next by thread: Re: How would you handle such situation?
  • Index(es):
    • Date
    • Thread