whats it mean by info hiding?

This is a discussion on whats it mean by info hiding? within the C++ Programming forums, part of the General Programming Boards category; I know it has to do with the data members but why is that good programming to do so? any ...

  1. #1
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    whats it mean by info hiding?

    I know it has to do with the data members but why is that good programming to do so? any examples why?
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

  2. #2
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Encapsulation

    To avoid other member functions/data members/classes to modify the data. Mainly used for data security.

    Hope I'm right.

    Can anyone second me?
    Last edited by biosninja; 11-11-2002 at 05:08 PM.

  3. #3
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378
    Originally posted by biosninja
    Encapsulation

    To avoid other member functions/data members/classes to mdify the data. Mainly used for data security.

    Hope I'm right.

    Can anyone second me?
    That definitely makes sense once i think about it. I mean why would you want others messing around with your stuff.

    Thnxs Ninja!
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Messing around with your stuff, indeed!

    Programmers only need to know that the class works, not what goes on behind the scenes. There's no reason to allow anyone to "mess" with the data.

    Easy way to turn a "class" into "trash".

    -Skipper
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  5. #5
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    O yeah.... That includes accessor functions - thats a special function that can actually access the data and or change it that is called out side of the class.....or something like that

  6. #6
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146

    Cool Data Encapsulation

    Here's what I've been told about professional programming. Programs are divided up into modules. Separate teams work on separate modules. Those teams don't know how the other teams are doing what they need to do; they only know what others are supposed to do. How anything is achieved is irrelevant. In order to achieve the modularity and granularity necessary for programming large problems in an efficient manner, information hiding is necessary.

  7. #7
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    encapsulation
    -----------------
    Definition :


    The restriction of knowledge to the scope of a module, i.e. data and implementation are encapsulated when the client can see only the service calls and no implementation details. Instance variables and methods can be added, deleted, or changed, but as long as the services provided by the object remain the same, code that uses the object can continue to use it without being rewritten.


    I got this from : Definition

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help displaying info from structure
    By kisiellll in forum C Programming
    Replies: 6
    Last Post: 04-04-2009, 12:51 PM
  2. Question about getting an info class from another Form
    By Joelito in forum C# Programming
    Replies: 0
    Last Post: 10-16-2006, 01:02 PM
  3. Help doing an e-mail program in c...
    By Tyler_Durden in forum C Programming
    Replies: 88
    Last Post: 01-02-2005, 02:12 PM
  4. Binary trees search problem...
    By Umoniel in forum C Programming
    Replies: 2
    Last Post: 02-22-2004, 01:29 PM
  5. Info hiding?
    By Mecnels in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-07-2003, 02:02 PM

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