Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   What are abstract data types? (http://www.programmingforums.org/showthread.php?t=14927)

code_warrior Jan 12th, 2008 1:47 PM

What are abstract data types?
 
if it isn't too much, could someone please help clarify why abstact data types create a layer boundary between modules. i also don't understand too much about why it is such a valuable approach and how it can be implemented in a language like c++ or java. also why is it useful to hide data and the code that processes the data.

Thanks for your time.
Code_Warrior

grumpy Jan 12th, 2008 5:04 PM

Re: What are abstract data types?
 
Abstract data types allow definition of a fixed interface (method of interaction) between modules. If there is not a fixed interface (i.e. the interface can change) between two modules then any change in one module can cause code in the other module to function incorrectly, forcing a need to retest (confirm if anything is functioning incorrectly) and then, if errors are encountered, to correct both modules whenever one changes. That translates into significantly more effort to maintain both modules, or to get them working correctly in the first place.

Data and code hiding simply means that the implementation details in one module are not made visible to other modules (i.e. there is a fixed interface).

I'll leave the question of implementing abstract data types or data/code hiding as a further exercise: there are many ways of doing that in both languages.

peaceofpi Jan 12th, 2008 9:07 PM

Re: What are abstract data types?
 
First post, a peculiarly worded set of questions...

I smell homework!

grumpy Jan 13th, 2008 2:10 AM

Re: What are abstract data types?
 
Quote:

Originally Posted by peaceofpi (Post 139569)
I smell homework!

As do I; one reason I did not provide a complete answer (he'll need to work to properly understand the notion of interface) and also did not provide examples. The original poster will need to think and understand before he can use my words.

Sane Jan 13th, 2008 2:19 AM

Re: What are abstract data types?
 
Ah, no wonder Grumpy's post was abnormally brief!

(For his standards, of course) :)

grumpy Jan 13th, 2008 2:42 AM

Re: What are abstract data types?
 
Ah, Sane, I'd like to show you the "V for victory" sign that your President Bush showed to the Australian people while visiting Canberra in 1992.

code_warrior Jan 13th, 2008 7:04 PM

Re: What are abstract data types?
 
actually grumpy's answer was pretty enlightening. as far as homework goes.....i don't know yet, my semester is starting tomarrow and i wanna get a head start on my data structures class by atleast getting a little bit of understanding on something that im sure i might have a problem with.

thanks.

lectricpharaoh Jan 14th, 2008 4:31 PM

Re: What are abstract data types?
 
Quote:

Originally Posted by grumpy
Ah, Sane, I'd like to show you the "V for victory" sign that your President Bush showed to the Australian people while visiting Canberra in 1992.

Sane, like me, is Canadian, not American. Our President Bush, indeed! :P

grumpy Jan 15th, 2008 2:15 AM

Re: What are abstract data types?
 
Only Canadians believe Canada is not part of the US!!!! :lol:

Infinite Recursion Jan 15th, 2008 9:49 AM

Re: What are abstract data types?
 
I'm American, but he isn't my president... I don't claim him. :)


All times are GMT -5. The time now is 3:43 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC