Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Forms & Form designer
>>While the other advice you've been given is correct, unless there's a good reason, I'd add the property in the Form Designer and just assign it in Init.
>>
>>Tamar
>
>What would drive the decision to do it one way or another?
If the property is always or almost always needed, it's better design to put in the class than to create it in an instance.
Sometimes, you have a class that you can't or aren't allowed to change (like from a library of some sort), so you have to add properties at runtime.
Also, there are some kinds of things you want to do that are better handled by runtime additions. For example, generic code to handle resizing often adds properties to hold onto some base values. The advantage of doing it that way is that the specific objects don't have to know anything about the generic code.
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only