home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8395 < prev    next >
Encoding:
Text File  |  1993-01-21  |  7.3 KB  |  171 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!gatech!concert!rock!taco!csemail.cropsci.ncsu.edu!samodena
  3. From: samodena@csemail.cropsci.ncsu.edu (S. A. Modena)
  4. Subject: Re: TurboVision Question (w/ example)
  5. Message-ID: <1993Jan21.141347.27567@ncsu.edu>
  6. Sender: news@ncsu.edu (USENET News System)
  7. Organization: Crop Science Dept., NCSU, Raleigh, NC 27695-7620
  8. References: <ppollet.156.727460280@cismibm.univ-lyon1.fr> <1993Jan20.183755.19926@ncsu.edu> <ppollet.167.727603372@cismibm.univ-lyon1.fr>
  9. Date: Thu, 21 Jan 1993 14:13:47 GMT
  10. Lines: 159
  11.  
  12. In article <ppollet.167.727603372@cismibm.univ-lyon1.fr> ppollet@cismibm.univ-lyon1.fr (Patrick POLLET) writes:
  13. >In article <1993Jan20.183755.19926@ncsu.edu> samodena@csemail.cropsci.ncsu.edu (S. A. Modena) writes:
  14.  
  15. >>Concerning this part of what Patrick says:
  16. >
  17. >>>              MyDialog^.SetData(Params);
  18. >>>              Desktop^.ExecView(MyDialog);
  19. >>>              .......
  20. >>>            end     
  21. >>>
  22. >>>    CAUTION : Since you are executing the Dialog by ExecView, The 
  23. >>>application is "put in the background" until the dialog is closed!
  24. >>>So there is no way for the appliaction to update the content of the 
  25. >>>paramtext while the dialog is ON SCREEN ....It could be done by the
  26. >>>dialog itself in its method HandleEvent, provided it "knows" the 
  27. >     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  28. >>>identifiers of the variables that hold the actual data... 
  29. >
  30. >
  31. >>Unfortunately, this is misleadingly incorrect.....Patrick has read
  32. >>the TV book and misinterpretted it.  :^)
  33.  
  34. I want to re-emphasis my point about how Patrick is looking at TV programming.
  35. Something he says below seems to confirm my contention.
  36.  
  37. >
  38. >[ Stuff deleted ]
  39. >
  40. >>This is known as "event-driven" programming.  Objects talk to each other!
  41. >
  42. >
  43. >    That's exactly what I said... ( by the Dialog itself in its 
  44. >     method handleEvent() !!!!!!
  45.  
  46. >    In your two examples you had to program response to events in the 
  47. >ON SCREEN dialogs for it to react  to focused events:
  48. >     -when you clicks on the button MASTER, of the First Dialog .  
  49. >     -when you double click on an item of the overlapping Dialog.   
  50. >
  51. >   And also you had to adapt the handleevent() methods in the 
  52.     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  53. >other dialogs when they received notification that something has changed 
  54. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  55. >elsewhere.
  56. ^^^^^^^^^^
  57.    Yes, that's what I said.....and you sort-of said....
  58.  
  59. >
  60. >   Whether it is a broadcast or a focused event makes no difference.
  61. >
  62. >   It is the ON SCREEN dialog that detect any modification to some 
  63. >   Data and requests all others to update.... 
  64. >
  65. >   Even if you do it at the application Idle level, you still have to
  66. >   program something like:
  67. >
  68. >      If the NewValue of some data has changed 
  69. >           send an updating event to Desktop to forward it 
  70. >           Update the New value  
  71.  
  72. Yes, I agree with what you've said up to this point.
  73.  
  74. >
  75. >      This is not really clean programming since the DATA must be global
  76.                !!! ^^^^^^^^^^^^^^^^^^^^^^^^           ^^^^^^^^^^^^^^^^^^^
  77. >   and in two occurences (one for the Oldvalue and one for the NewValue...)
  78. >   So objects do talk to each others but also uses some global data 
  79. >   in common....
  80.  
  81. It's in the preceeding paragraph that Patrick drives his Simca off the
  82. road and into the ditch.
  83.  
  84. 1) It is simply not true that *global* data need be involve....not at all.
  85.    Strictly private data may be passed around...or an address to private
  86.    data.  In fact, it is possible to program the objects to *first* use
  87.    use broadcast techniques to establish the correct respondant 
  88.    relationship.
  89.  
  90. 2) Notice that Pat thinks that event driven programming and objects
  91. talking to each other is not "clean" programming.   This is why I said
  92. that Patrick was terrific at TP syntax, but doesn't understand TV poetry.
  93.  
  94. Pray tell me: What is the purpose of being allowed to create DESCENDANT
  95. classes and to override VIRTUAL methods?
  96.  
  97. This is an issue "clean programming?"  You have a perverse notion of
  98. what "dirty" programming is.
  99.  
  100. >
  101. >  In real OOP languages (Frame languages such as Shirka,KL-1,Yafool..) 
  102.       ^^^^^
  103.      Pay attention to that key word: "real"
  104. >objects uses REFLEX-methods  that sense any modification of their 
  105.               ^^^^^^^^^^^^^^
  106. >environnement  and reacts WITHOUT the need for the object responsible of 
  107. >the modification to  signal in some way that something has happened.
  108. >  But TP is not a real OOP language by b[ut] hybrid language.
  109.  
  110. A couple of points: I'm programming with TP and TV, so those obscure
  111. academic languages, mentioned above,  have nothing what-so-ever with
  112. the topic under discussion.
  113.  
  114. Next, may I reiterate, I was taking about EVENT-DRIVEN PROGRAMMING,
  115. and you, it appears, are giving advice from a REFLEX-method prejudice.
  116.  
  117. Is Turbo Pascal a HYDRID language?  Of course, it is!  That is precisely
  118. *why* I use it.  Of course, the word you are looking for is "mongrel." 
  119. TURBO PASCAL is a MONGEL language (or... TP is MONGREL implementation of
  120. ISO PASCAL.)   :^)
  121.  
  122. I suspect that Patrick is looking at this whole thing through the
  123. eyes of an academician, whereas I am programming a real-world
  124. application for distribution to people who will use it to accomplish
  125. real work.  I use TP and TV because they are a *practical* solution
  126. to the need at hand.....otherwise I won't step down from the purity
  127. of Yafool...  (BTW, you do understand the PUN in the name of that
  128. language?)...
  129.  
  130. >
  131. >      OOP do give some real powerful tools to programmer, but one 
  132. >should keep in mind the BASIC concepts of modular programming:
  133. >    -the minimal amount of global data
  134. >    -the mimimal interdependance of modules (whether objects or simple
  135. >       procedures) to each other.
  136. >    -no object should have a direct reference to another one 
  137.  
  138. Well, there you go, talking about *modular* programming.  OK, look back at
  139. what I was talking about (event-driven programming) and I think you will
  140. see that I obeyed your three dicta of *modular* programming under the
  141. EVENT-DRIVEN case using a OBJECT-ORIENTED implementation.  :^)  BTW, I use
  142. TP and TV because they ease adherence to MODULAR programming, which I
  143. very much favor.  :^)
  144.  
  145. >    
  146. >ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  147. >--------------------------------------------------------
  148.  
  149. To repeat my cautionary: TV application framework objects are designed
  150. to be modified by the techniques of class derivation and virtual
  151. method override.  In particular, TV is event-driven and you are encouraged
  152. to be event-driven-minded, to be experimental, and to "play" with
  153. the OO and event-driven features as they were intended to be, rather
  154. than attempt uses then in a structured-analysis frame-of-mind.
  155.  
  156. Ciao,
  157.  
  158. Steve
  159. ---
  160. +------------------------------------------------------------------+
  161. |     In person:  Steve Modena     AB4EL                           |
  162. |     On phone:   (919) 515-5328                                   |
  163. |     At e-mail:  nmodena@unity.ncsu.edu                           | 
  164. |                 samodena@csemail.cropsci.ncsu.edu                |
  165. |                 [ either email address is read each day ]        |
  166. |     By snail:   Crop Sci Dept, Box 7620, NCSU, Raleigh, NC 27695 |
  167. +------------------------------------------------------------------+
  168.          Lighten UP!  It's just a computer doing that to you.    (c)
  169. OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
  170.          
  171.