Does it seem strange to anyone else that an event method for a PDS in a class has to be declared public, even though the PDS is totally enclosed in the class?
At least surprising and non OO...
but to be clear, the ProDataset has no events. ProDatasets have Callbacks, and unter that term public is more expected.
Well, callbacks from what? In this case, it seems like it is only from the AVM, since there is no external ABL code involved. That's why it seems wrong with me. I get that if I have multiple classes participating in something that I need to make public the parts I expect other classes to trigger, but that doesn't apply here.
Callbacks from the AVM to your code?
"That's why it seems wrong with me."
It's been like that since roundabout 10 years now. After that time features typically are considerd accepted by the customer.
PDS have been around for that long, but afair, not using methods. The same principle *should* apply in a PP, of course, but people haven't thought so much about private and public there.
The same principle *should* apply in a PP, of course, but people haven't thought so much about private and public there.
Trust me. The same principle does apply to persistent procedures.
Twisting my words, eh. What I meant was that one *should* want to encapsulate a PP just as much as a class and therefore one should object to having to leave the IP public ... just that many people haven't been thinking about the private/public status of IPs the way they do with methods.
Twisting my words, eh.
Not my intention.
So I guess we agree that a good framework needs to provide a structure in which the publicness of dataset callback methods does not create a too big problem with OO principles.
If one encapsulates the PDS completely in a class and avoids calling the public event methods, no trouble is going to ensue, but it requires one to behave correctly rather than enforcing that behavior.
Encapsultation is _ALWAYS_ something that the programmer of a class needs to care about every day. So it's not worse than suggesting other standards, like NO-UNDO variables, NO-LOCK reads etc.
We have no disagreement on that. My issue here is that one can't flag these event methods as private, even though they are used by no ABL code outside the class.