Encapsulation

Unknown | 1:03 AM |

Many a times when we use certain tools, we hardly pay attention to the details
about the functionality of the tool. We hardly pay attention to the various other
units, which make up the tool. This behavior to ignore unwanted details of an
entity is termed as abstraction.
Now if the details are unwanted why show them to the user? Therefore, the
creator might attempt to hide these unwanted details. This behavior is termed as
encapsulation. So we can say that encapsulation is an implementation of
abstraction. Encapsulation directly leads to two main advantages:

Data Hiding: -- The user of the class does not come to know about the internals
of the class. Hence, the user never comes to know about the exact data
members in the class. The user interacts with the data members only through the
various member functions provided by the class.

Data Security: - Since the data, members are not directly available to the user
directly but are available only through the member functions a validity check can
always be imposed to ensure that only valid data is been inserted into the class.
So a Date class, which contains individual data members for storing date, month
and year, will have it ensured the month is never 13 or the date is never
exceeding 31.

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....