home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8532 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.5 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!lhc!adm!news
  2. From: lee@cpu.us.dynix.com (Lee Crites)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: ADT & BTW7.0??? Help me!
  5. Message-ID: <35215@adm.brl.mil>
  6. Date: 25 Jan 93 19:47:56 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 49
  9.  
  10.  
  11. On 25 Jan 1993, Duncan Murdoch wrote:
  12. > What's an abstract data type?
  13.  
  14. ADT is, like OOP, a way of 'encapsulating' the data and
  15. procedures/functions that operate on that data.  We have built all of our
  16. Pascal Units with ADT in mind, which is one reason why we are able to
  17. convert them into OOP as easily as we are.
  18.  
  19. In a nutshell, an ADT is, by definition, in a separately compiled module
  20. (unit).  I contains all of the TYPE, VAR, CONST definitions, all needed
  21. setup (in the BEGIN/END. block), and all of the procedures and functions
  22. needed to manipulate the information. 
  23.  
  24. It appears to me to be an intermediate step into OOP, in that the data and
  25. 'methods' are put together.  Of course, there is nothing like inheritence,
  26. since it is a basic unit, but the basic data/method thought is there. 
  27.  
  28. We use it like this:  There is one UNIT that manipulates the .INI file. 
  29. Nobody needs to know what the .INI file looks like, or how it is being
  30. read or written to.  The only person who changes the source is the one
  31. programmer that has responsibility for INI.PAS.  The rest of us simply
  32. include INI in our USES clause.  There are functions that return values,
  33. etc, that we use, and who cares how they work.  All that matters is that
  34. they work.  Each UNIT has a person responsible for keeping it up to date. 
  35. Everybody else simply uses the function/procedure calls as needed.
  36.  
  37. You have 'abstracted' the data, and the functionality needed to keep it
  38. up, from the end-user programmer/staff.  If the indexing methodology
  39. changes, or the file-layout itself changes, you, the end-user programmer
  40. neither know or care.
  41.  
  42. We actually went to the length of adding some security to each unit so
  43. that if you didn't have the proper authorization code, you couldn't do
  44. everything (delete records, change setup parameters, etc), further
  45. 'abstracting' the information.  This was quite useful in such applications
  46. as employee file manipulation, where some field(s) and some functions were
  47. not available to everyone.
  48.  
  49. Does this make it clear as mud?!?
  50.  
  51.            =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  52.             lee@us.dynix.com | If it ain't broke yet,
  53.                              |   let me have a shot at it....
  54.            =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  55.  
  56.  
  57.