For example if i stored the score of a fantasy

This preview shows page 6 - 9 out of 17 pages.

For example, if I stored the score of a fantasy baseball game in an integer format, you could store that as an int data type in your class. If you decide to then add decimal values to your score you could convert the data type to a decimal data type. If you had exposed these variable to users of the class, they would be impacted. Does that make sense?
Collapse Mark as Read RE: Data encapsulation, data hiding and software reusability Professor Steelman Email this Author 5/8/2016 7:48:44 PM Roland - An example of a class that is reused - In my current system we have a class that represent a flight's position. This position class is used in many different parts of the system. The class can be reused all over the system without having to be rewritten. Composition is a case where one class contains another class as a data member. This is slightly different than inheritance. Do not worry too much about this concept - this is not needed for this course as it is a bit advanced. Collapse Mark as Unread RE: Data encapsulation, data hiding and software reusability Franklin Lyburn Email this Author 5/4/2016 10:33:18 AM Encapsulation is a OOP concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse. Data hiding does the same thing, but it is mainly used to hide internal object details. And reusability is the use of these existing assets, within the software development progress. Collapse Mark as Unread RE: Data encapsulation, data hiding and software reusability Andrea Mcknight Email this Author 5/4/2016 12:00:19 PM Data encapsulation in basic terms is hiding the nonessential details of an object. It allows an object to supply only the requested information to another object and hides the nonessential information and that's because users don't need to know how implementation takes place so they're prevented from modifying attributes. Only interfaces/methods can modify encapsulated data. Data encapsulation can be thought of as a goal. Data hiding from what I understand is basically a way of achieving that goal. So I guess it would be safe to say that data hiding is not possible without data encapsulation but encapsulation is possible without data hiding. Data hiding just provides a way to protect/prevent data and object integrity from unintended or even intended changes. Software reusability is simply the process of either implementing or updating software systems using existing software components. It allows programmers to be more efficient because the same code can be developed once and used in many different applications. Collapse Mark as Unread RE: Data encapsulation, data hiding and software reusability Andrea Mcknight Email this Author 5/5/2016 10:40:50 AM
Hi Edward, I'm not 100% sure but I believe an example of data encapsulation/data hiding could be something as simple as how we use a calculator. You know how when we do 2+2 and the calculator gives us the answer 4? The calculator gives us the results but it hides the implementation. I guess another example could be our cell

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture