Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions for custom methods?
Message
 
 
To
20/11/2008 20:05:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01362229
Message ID:
01363448
Views:
52
>>>OK, nothing so earth-shattering, but it's a nice thing that I've found quite handy in several situations. Imagine that I want to impose new behavior on several controls, few of which I can't even subclass - or there's no need to subclass them for this one time. I'll simply bindevent() their gotfocus and lostfocus, and addproperty() in the first, use it in the second. The code is in only one place, no need to visit or subclass each. The code may, for example, save a few of the old properties into .saveXXX properties and restore them on lostfocus, without writing a single byte to any of the classes - everything is in the binding object.
>>
>>If you're going to change code, why don't you just add the property to the class? This way still seems a little "Look, Ma, no hands" to me, i.e. silly code tricks.
>
>Which keeps working on new objects if someone else adds them to the form, new classes which may appear etc, and you don't even have to remember to add the feature to them. It is "look, no hands", no less.

You're adding a property to the class whether you add it to the definition or add it on the fly. In terms of source control and code integrity I know which way I prefer.

We've probably batted this back and forth long enough, no? If we start up again it should at least be in the .NET section. As someone said, .NET developers who wouldn't see this thread would probably join in.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform