Re: Switch on GET/SET accessor

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tamir Khason (tamir-NOSPAM_at_tcon-NOSPAM.co.il)
Date: 02/18/04


Date: Wed, 18 Feb 2004 21:16:36 +0200

Thank you for response, but I sill have problem with it :)

I'll try to be more specific...

Two patterns:

1#
I have class named ItemInTheStore it has type (car, dressware, bread)
If the type of Item is FOOD, I do not need property named bra size, but I
still want to present it in the grid with NULL value in column size, but not
0 (or -1) 'cos it's integer

2#
I have class of experiment and it has type (type a and type b) in case of
type A value of hemoglobin level (for example) is obsolete and make no
sense, but ExperimentCollection has membes of both types and they should be
displayed together in the grid, but hemoglobin level value (float) column
should be NULL (not 0) in case of experiment type A

I believe it's clearer now ;)

"Stoitcho Goutsev (100) [C# MVP]" <100@100.com> wrote in message
news:OmEi69k9DHA.3648@TK2MSFTNGP11.phx.gbl...
> Hi Tamir
>
> > I found some workaround by using #if directives.... Still looking for
> better
> > solution.
>
> #if directives are preprocessor directives. You can include/exclude some
> portion of your source files for compiling. You cannot use preprocessor
> directives at run time. As far as I can see from your code you want to
> add/remove properties at runtime. This is not posible.
>
> > Stoitcho, I want to explain the propose of such thing:
> > I have data class which has some propertie of type. In some type other
> > properties are obsolete, so nothing in the program will go to use or
bind
> > it, but if there is other type of the class those properties are needed.
> > Of couse it possible to build abstract class and inherit from, but it is
> not
> > very good idea, when your objects are for data propose only and will not
> be
> > runed anyway.
> > So, if you still think that it does not make sense, response and we'll
> > discuss about... :)
>
> Frankly, it still doesn't make sense to me. IMHO you need to completely
> different classes. How you said they can share common base class or
> interface. There are some design patterns that might help you:
> ObjectFactory, Adapter or even visitor.
>
> Ofcourse maybe I'm not gettig your problem correctly. If you post some
> simple example of what do you need it may help us a lot.
>
> B\rgds
> 100
>
>



Relevant Pages

  • Reply to Wolf
    ... pulses in response to the current energy inputs and recent ... happens to them as they travel from the sensors to the ... different keys close contacts in different patterns, ... primitive behaviors that could be chained and combined" (how ...
    (comp.ai.philosophy)
  • try not to chew the restrictions where, campaign them normally
    ... partial professors return. ... While disorders fiercely long diagrams, ... patterns often select in addition to the roasted checks. ... Let's differ in response to the various maids, ...
    (sci.crypt)
  • Re: psychedelics and Nirvana
    ... stuff and nasty patterns in us that we normally suppress. ... The 'best', or most therapeutic response at least, ... you're basically doing in that solution is taking a trusted subset ... but make fun of yourself as well as the other. ...
    (talk.religion.buddhism)
  • Re: Hypercardioid
    ... of the microphone and the sound that gets to the rear. ... And different assemblies will change the response ... makes their polar patterns different. ...
    (rec.audio.pro)