Re: Abstract Data Types - Separating Interface from Implementation
From: Anon Email (anonemail1_at_fastmail.fm)
Date: 12/24/03
- Next message: Jeff Schwab: "Re: [OT] Can anyone recommend a good game library?"
- Previous message: CoolPint: "Re: Help Please: Passing Functor Object with Template type parameter"
- In reply to: John Carson: "Re: Abstract Data Types - Separating Interface from Implementation"
- Next in thread: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- Reply: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- Reply: John Carson: "Re: Abstract Data Types - Separating Interface from Implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Dec 2003 21:32:04 -0800
Thanks guys.
> You seem to be confusing implementation code and client code.
Yes, you are right - I am confused. I'm confused by the terms
implementation code, client code and interface. And I'm unsure as to
why abstract data types are called "abstract".
1) Put simply, is client code non-class code?
2) Is the aim to make a class interface like a "skeleton" of the class
implementation?
3) Is the class interface typically found in your header file?
3) Is the class implementation typically found in your source file?
4) Are abstract data types "abstract" because they are specified
separate to implementation?
5) In Bjarne Stroustrup's "The C++ Programming Language" on p317, he
talks about the class "I_box," and seems to use the terms "interface"
and "implementation" interchangably. Is there such a thing as an
"implementation interface", as opposed to an interface?
The following is confusing for me:
" Our implementation choice is to use an array of integers. It would
be nice to be able to separate the interface from the implementation.
In some languages it is actually possible. Not so in C++ (or, at
least, not without some gymnastics). The reasons are mostly
technological. The compiler would have to have knowledge about all the
files involved in the project in order to allow for such separation.
In C++, the best we can do is to separate the details of the
implementation of some member functions into the implementation file.
The interface file, however, must contain the definition of the class,
and that involves specifying all the data members. Traditionally,
interfaces are defined in header files with the .h extension. Here is
the stack.h interface file."
This comes from the following page on abstract data types:
http://www.relisoft.com/book/lang/scopes/11abstr.html
I'm trying to envision his "ideal" situation, where the interface is
separated completely from the implementation. Any further insight
greatly appreciated.
Cheers,
Deets
- Next message: Jeff Schwab: "Re: [OT] Can anyone recommend a good game library?"
- Previous message: CoolPint: "Re: Help Please: Passing Functor Object with Template type parameter"
- In reply to: John Carson: "Re: Abstract Data Types - Separating Interface from Implementation"
- Next in thread: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- Reply: Jeff Schwab: "Re: Abstract Data Types - Separating Interface from Implementation"
- Reply: John Carson: "Re: Abstract Data Types - Separating Interface from Implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|