The term encapsulation is often used interchangeably with information hiding, while some make distinctions between the two [1]. It seems that people, however, fail to agree on the distinctions between information hiding and encapsulation though one can think of information hiding as being the principle and encapsulation being the technique. A software module hides information by encapsulating the information into a module or other construct which presents an interface.
The most common use of information hiding is to hide the physical storage layout for data so that if the physical storage layout is changed, the change is restricted to a small subset of the total program. For example, if a three-dimensional point (x,y,z) is represented in a program with three floating point scalar variables and later, the representation is changed to a single array variable of size three, a module designed with information hiding in mind would protect the remainder of the program from such a change.
2007-01-29 01:50:03
·
answer #1
·
answered by DarkChoco 4
·
1⤊
0⤋
From a programming perspective encapsulation involes taking similar pieces of functionality and placing them into one area of code for easy access and maintenance.
You could call these areas functions, sub routines, classes, include files, etc depending on the language you are using. Encapsulation could be thought of at the code level, or at the file level, or at any level of an architecture where a commmonly used functionality is abstracted enough that it can be accessed from a variety of places and serve as the authoritative source for whatever information it's being asked for.
This type of methodology makes maintaining code easier. It makes code more predicable. It makes changes easier. Some cautionary notes might be not to encapsulate too agressively. The reason for this is your encapsulation will eventually become so rigid in it's abstractness that a change you make might affect other areas of the code because they cannot propery handle the new return of your changes. However, if you've thought out throughly enough your design, this should not be a problem for a while to come.
2007-01-29 02:12:39
·
answer #2
·
answered by dave_exby 1
·
0⤊
0⤋
What Is Meant By Encapsulation
2016-11-06 20:00:02
·
answer #3
·
answered by silvi 4
·
0⤊
0⤋
Encapsulation may refer to:
separation of concerns and information hiding, in software engineering, the process of enclosing programming elements inside larger, more abstract entities
integrated circuit encapsulation, in electronics the design and manufacture of protective packages
micro-encapsulation, means to confine material
molecular encapsulation, means to confine molecules
encapsulation (pharmacology), to enclose medicines in a usable form
encapsulation (networking), in computer networking, is to include data from an upper layer protocol in a lower layer protocol
2007-01-29 01:49:35
·
answer #4
·
answered by Toffy 1
·
0⤊
0⤋
It means "Hiding Details". In object oriented programming it is when you make your variables private to an instance of a class.
2007-01-29 01:45:59
·
answer #6
·
answered by The Master 5
·
1⤊
0⤋