On 25 Apr 2003 at 2:27, Frank Heckenbach wrote:
[...]
Sure, storing them is easy. The question is what to do with them afterwards?
That can be left to the programmer to do something with it, or to do nothing with it. Never underestimate the ability of programmers to do something with something ;-/
Sorry, such blanket statements don't impress me.
Each to his own - but I don't think anyone person can presume to know what any number of other people could do with any particular feature in a piece of software. Of course one may know what one would prefer for others not to do - but in the end, people will do what they choose/need to do. So, if you can store the integer values, please store them. Others can then decide for themselves what (if any) they want to do with it.
[...]
Type TMethodType = Procedure (Sender : pObject);
So, you don't make it dependent only on the programmer's "discipline", but also on the internals (here, calling conventions of methods).
I am not sure what the objection is here. This is precisely how BP's OWL framework and Delphi's VCL framework operate. You might not like it, and it might prove restrictive for programmers who would like to do things differently, but BP and Delphi programmers have been coping quite well for a very long time.
If they ever change, this will just break.
It never changed in BP's OWL, and it will never change in Delphi's VCL. I am not expecting mine to change either. In any case, anything can change in any library, OOP framework, or software. If that happens, people have the option of not upgrading to the new version (just like some BP programmers decided to ignore Delphi), or making the necessary changes in their code. This is not rocket science, and it happens everywhere - in gcc, gpc, and many other things.
[....]
So you need in a) a `case' statement and abstract method declarations or b) a `case' statement, virtual method declarations and aborting implementations. All of them can be produced fully automatic, given the list of codes.
You cannot have a list of all possible codes in advance. In BP or Delphi, all I need to do is: Procedure foo (Var Message : TMessage); virtual my_integer;
"my_integer" can be any integer value that I choose (and of course there is no way for Borland to predict what it will be). Yet I know that whenever the user clicks on or selects a control or menu item with the ID of "my_integer", then my method "foo" will be executed. I don't have to bother myself with a case statement, or anything other than to have my method in the format described above. I am not sure that I understand what is so objectionable about this.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/