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