comp.lang.ada
 help / color / mirror / Atom feed
* HELP-Information hiding/Abstraction (explain difference please)
@ 1995-03-07 11:53 Jacky
  1995-03-08 11:38 ` Tucker Taft
  1995-03-12  6:50 ` Samuel Mize
  0 siblings, 2 replies; 3+ messages in thread
From: Jacky @ 1995-03-07 11:53 UTC (permalink / raw)


Could someone please explain the difference between
information hiding and data abstraction - Is there one?

I would be grateful for any simple small pieces of code that
help show the difference.  I have been through books etc
and as far as I can see they are one and the same....
Please help!!!
E-mail me direct too, if poss.

Thanks in advance.

J. Green


-- 
--
********************************************************
*                QUOTE OF THE WEEK:                    *
******************************************************** 
*                                                      *
*JOHN CANDY:  "I'm not wimping, I'm thinking"          *         
*              THE GREAT OUTDOORS                      *
********************************************************



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HELP-Information hiding/Abstraction (explain difference please)
  1995-03-07 11:53 HELP-Information hiding/Abstraction (explain difference please) Jacky
@ 1995-03-08 11:38 ` Tucker Taft
  1995-03-12  6:50 ` Samuel Mize
  1 sibling, 0 replies; 3+ messages in thread
From: Tucker Taft @ 1995-03-08 11:38 UTC (permalink / raw)


Jacky (j_green@icrf.icnet.uk) wrote:

: Could someone please explain the difference between
: information hiding and data abstraction - Is there one?

Information hiding is a more general and somewhat lower level
concept than data abstraction.
Most abstraction (data abstraction, procedural abstraction) uses
information hiding to force the client to use the abstraction.
Similarly, "modularity" uses information hiding to ensure that
interdependences between modules are minimized.

Abstraction is designed to raise the "level" of discourse, so
that client routines can deal with data and operations at a more
appropriate application-oriented, representation-independent level.

Modularity is designed to break an application upon into manageable,
relatively independent pieces.

Information hiding is a mechanism to prevent client routines from
using certain data or operations.  However, there is no direct
implicatation that this has the effect of raising the level of
discourse.  It may simply be hiding certain "dangerous," "privileged," 
or simply "irrelevant" data or operations from the client.

: I would be grateful for any simple small pieces of code that
: help show the difference.  I have been through books etc
: and as far as I can see they are one and the same....

Information hiding serves both abstraction and modularity.
All three concepts are closely related, and in any given system,
it may be difficult to say where abstraction begins and modularity
leaves off.  

In general, "data abstraction" is associated with the definition
of user-defined data types, which are designed to represent
some higher-level application-oriented entity.

"Procedural abstraction" is associated with the definition of
functions and procedures that encapsulate some useful application-oriented
functionality.

"Modularity" is associated with breaking a large application up into
appropriately-sized modules, with limited dependence between the modules.

"Information hiding" is usually accomplished by some language feature
that allows some information to be visible only to certain modules.
What you do with this feature is up to the programmer.

: Please help!!!

Sorry I don't have time to produce a real example.

: E-mail me direct too, if poss.

Will do.

: Thanks in advance.

: J. Green



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HELP-Information hiding/Abstraction (explain difference please)
  1995-03-07 11:53 HELP-Information hiding/Abstraction (explain difference please) Jacky
  1995-03-08 11:38 ` Tucker Taft
@ 1995-03-12  6:50 ` Samuel Mize
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Mize @ 1995-03-12  6:50 UTC (permalink / raw)


In article <j_green-070395115500@merlin.clh.icnet.uk>,
Jacky <j_green@icrf.icnet.uk> wrote:
>Could someone please explain the difference between
>information hiding and data abstraction - Is there one?
>
>I would be grateful for any simple small pieces of code that
>help show the difference.

-----------------------------------------------------------
Data abstraction:

package Abstractions is

  type Stoplight_Color is (Red, Yellow, Green);

  type Person is
    record
      Age: integer;
      -- Lots more fields full of data -- but you can handle
      -- a person as a single, higher-level item.
      --
      -- The concept "person" is abstracted.
      --
      -- The information is NOT hidden -- a 
    end record;

end Abstractions;
-----------------------------------------------------------
Information hiding:

package Hidden_Info is

  type Person is private;

  -- specs for procedures and functions on Person given here

private
  type Person is
    record
      Age: integer;
      -- Lots more fields full of data -- but you can handle
      -- a person as a single, higher-level item.
      --
      -- The concept "person" is abstracted.
      --
      -- The information is HIDDEN -- someone using this package
      -- CANNOT access the record fields.  The user MUST user
      -- the provided procedures and functions.
    end record;

end Abstractions;
-----------------------------------------------------------
As a rule of thumb, information hiding is used to enforce
data abstractions.

Any time you create a user-defined type, you are defining a
data abstraction.

Any time you avoid putting implementation details into the
visible specification of a package, you are using information
hiding.

Samuel Mize - smize@starbase.neosoft.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1995-03-12  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-07 11:53 HELP-Information hiding/Abstraction (explain difference please) Jacky
1995-03-08 11:38 ` Tucker Taft
1995-03-12  6:50 ` Samuel Mize

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox