home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!world!art
- From: art@world.std.com (Al Thompson)
- Subject: Re: TP units question
- In-Reply-To: stone@cunixb.cc.columbia.edu's message of Fri, 4 Sep 1992 14:12:03 GMT
- Message-ID: <ART.92Sep5134221@world.std.com>
- Sender: art@world.std.com (Al Thompson)
- Organization: The World Public Access UNIX, Brookline, MA
- References: <1992Sep4.141203.28370@news.columbia.edu>
- Date: Sat, 5 Sep 1992 18:42:21 GMT
- Lines: 21
-
- In article <1992Sep4.141203.28370@news.columbia.edu> stone@cunixb.cc.columbia.edu (Glenn Stone) writes:
-
- If a procedure/function is only used within the implementation section
- of a unit, it doesn't have to be declared in the interface section,
- but is there any disadvantage to doing so? I'm using TP 5.5.
-
- Disadvantage? No, a great advantage. One of the major motivations
- behind the units concept is that of information hiding. So, if a
- procedure is ONLY used in the implementation section it should NOT appear
- in the interface section. Any program or unit that imports this unit
- will be able to use that procedure, and you obviously don't want that.
-
- Another issue is the "working" philosophy of units. The interface
- section defines how the unit looks to the outside world. The
- implementation section defines how the unit performs its functions. The
- idea is that I can change my implementations any time the spirit moves
- me. The only(?) thing I need to do is to be 100% certain that the new
- implementation produces exactly the same behavior as the old. That is,
- the interface predicates must be invariant from implementation to
- implementation.
-
-