• 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
Re: How would you handle such situation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How would you handle such situation?


  • Subject: Re: How would you handle such situation?
  • From: Dev WO <email@hidden>
  • Date: Wed, 3 Aug 2005 20:22:14 +0200

Hi David,
I don't actually use ProjectWonder:( I tried to look at it but it pretty much scared me;)
I'll probably give it another try;)
Thanks for the pointer, I'll have a look at it.


Xavier



On 3-Aug-05, at 12:58 PM, Dev WO wrote:


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?


Personally, I'd probably avoid setting up instance variables unless you'd see significant performance problems from not.


Since I use ProjectWonder I'd take a look at ERXInstanceOfConditional and use that in my component.

--
;david

--
David LeBer
Codebase Software Systems
site:   http://www.codebase.ca
blog: http://david.codebase.ca




_______________________________________________ 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
References: 
 >How would you handle such situation? (From: Dev WO <email@hidden>)
 >Re: How would you handle such situation? (From: David LeBer <email@hidden>)

  • Prev by Date: Re: How would you handle such situation?
  • Next by Date: Re: How would you handle such situation?
  • Previous by thread: Re: How would you handle such situation?
  • Next by thread: Re: How would you handle such situation?
  • Index(es):
    • Date
    • Thread