Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions for custom methods?
Message
From
19/11/2008 13:48:52
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01362229
Message ID:
01362885
Views:
27
>>>OK, now I see what you are getting at. Typically a class contains something called a property which reads and/or writes each piece of data defined by the class. You update a value by calling its Set method, and retrieve it by calling its Get method.
>>
>>IOW, you can't access the properties directly as you do in VFP, but need code for each of them. Not sure I like that, either, but that's a different story. "Typically"? I.e. are there exceptions?
>>
>
>Sure, you can do it the old way by coding a Get method and a Set method. The main difference is you reference a property like a field rather than a method, i.e. no parentheses. As far as writing code, yes, you do have to write it, but IntelliSense does most of the work for you. Type "prop", press Tab and Enter, and it generates a stub. You change the data type and field name and it propogates those. It's a very simple, quick process.

Now a piece of code can access a property .blabla directly only if the name of the piece is .blabla_set or .blabla_get? And nothing else can access them unless such pieces of code exist? For every knowing property out there you need to WRITE code? And the code is something like

proc blabla_get()
return this.blabla

proc blabla_set(tuVal)
this.blabla=tuVal

C'mon, this couldn't have been a default? Couldn't have had a couple of bits somewhere, declare the property hidden or public or something if you want it (in)accessible? To me, this is the most unproductive side of it, even if it's for custom properties only (which I don't know). Needlessly multiplies the amount of code, creates a bunch of places where a bug can creep in - among hundreds of such generated snippets, one contains an accidental typo so it returns this.num instead of this.bum)

Sheesh... "It's a very simple, quick process" sounds like something a dentist may tell you ;).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform