ADT question

This is a discussion on ADT question within the C++ Programming forums, part of the General Programming Boards category; If you violate the walls of an ADT in a program, will the program run? The wall is basically all ...

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    40

    ADT question

    If you violate the walls of an ADT in a program, will the program run? The wall is basically all the operations right?
    I am just reading about this and want to make sure I understand it.

    Thanks!!!

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    I'm not sure what you mean by "the walls."

    The wall is basically all the operations right?
    if you were to ........ one of the operations or any function by say sending invalid parameters, it may crash, it depends how you handle it. You can have it crash, or you can do some error checking and have the operation/function do nothing.

    If you mean memory bounds of an ADT, it will hopefully crash when you're debugging, and will definitely crash if try accessing NULL pointers. If you run it in some sort of release mode or a stand alone exe, the chances of it crashing are lower. At that point, the OS has to tell you if the program is pointing somewhere it shouldn't.

  3. #3
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Location
    Mt. Prospect, IL
    Posts
    2,572
    use exceptions

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >If you violate the walls of an ADT in a program, will the program run?
    Yes, it just may not run if any changes are made to the ADT. The wall is basically data hiding. The client has no idea about the internal workings of an ADT, just the interface. As long as the client only uses the interface, the ADT can change its implementation drastically provided the interface never changes. If the client relies on knowledge of the ADT's internal workings, the wall collapses and the code becomes brittle. Any changes to the ADT could potentially break all code that relies on a certain implementation.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with linked list ADT and incomplete structure
    By prawntoast in forum C Programming
    Replies: 1
    Last Post: 04-30-2005, 01:29 AM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21