44 Organizing a Program with Object-Oriented Programming Object-oriented programming solves two glaring problems with structured programming: reusability and modeling. Reusability means that you can collect smaller programs that work together, store them in a larger group called an object, and then plug those objects into different programs like Lego building blocks. Where structured programming encourages reusability by letting you reuse subprograms, object-oriented programming encourages reusability on a larger scale by letting you reuse objects (which contain multiple smaller programs). Reusing individual subprograms is like using bricks to build a house. Reusing objects is more like using premanufactured walls to build a house. Modeling means that programming is more intuitive. One of the reasons why assembly language is so hard to understand is because manipulating data in the processor’s registers has nothing to do with solving problems like adding two numbers together. Likewise, dividing a large program into smaller tasks, using structured programming, does nothing to help you understand the actual problem the program is trying to solve. For example, suppose you had to write a program to land a rocket on the moon. This is how you might write this program using structured programming: Land a rocket on the moon Launch rocket Guide rocket through space Find a landing area on the moon Put rocket down on landing area So far, structured programming seems logical, but what happens when you keep dividing tasks into smaller tasks? Just focusing on the Guide rocket through space task, we might wind up with the following: Guide rocket through space Get current coordinates Compare current coordinates with moon coordinates Adjust direction Dividing the Adjust direction task into smaller tasks, we might get this: Adjust direction Identify current speed and direction Determine angle needed to steer towards the moon Fire thrusters to change the angle of the rocket Notice that the deeper you keep dividing tasks, the more removed you get from knowing what the main purpose of the program may be. Just by looking at the task Identify current speed and direction, you have no idea whether
Organizing a Program with Object-Oriented Programming 45 this task involves flying a rocket to the moon, driving a car down a road, or controlling a walking robot to an electric outlet to recharge its batteries. Book I Chapter 2 The more you divide a larger task into smaller tasks, the harder it can be to understand what problem you’re even trying to solve. This gets even worse when you start writing actual program commands. The two parts of most programs are the commands that tell the computer what to do and the data that the program manipulates. So if you wrote a program to identify the current speed and direction of a rocket, the commands would tell the computer how to retrieve this information and the speed and direction would be the actual data the program uses. Different Methods for Writing Programs Essentially, program commands are separate from the data that they manipulate. If one part of a program manipulates data incorrectly, the rest of the program winds up using that contaminated data and you, as the programmer, won’t know which part of the program screwed up the data. This is like sitting in a baseball game, ordering a hot dog from a vendor, and having six people pass your hot dog down to you. When you see fingerprints all over your hot dog, can you tell which person touched your food? Objects isolate data Object-oriented programming avoids this problem by combining data and the commands that manipulate them into a single entity called (surprise!) an object. With object-oriented programming in the hot dog vendor analogy, instead of passing your hot dog to half a dozen other people, the hot dog vendor comes directly to your seat and hands you your hot dog. Now if you saw fingerprints all over your hot dog, you’d know that the fingerprints could only have come from the hot dog vendor. Besides keeping data isolated from other parts of your program, object-oriented programming also helps you divide a large program into smaller ones. Although structured programming divides a large program into the tasks that need to be performed, object-oriented programming divides a large program into real-life objects. So if you were designing a program to launch a rocket to the moon, objectoriented programming would let you divide the program into objects. One object might be the rocket, a second object might be the moon, and a third object might be the Earth. You can also divide a large object into smaller ones. So the rocket object might be divided into an engine object and a guidance object. The engine object could be further divided into a fuel pump object, a nozzle object, and a fuel tank object.
Agreed in 2016, the motive of the General Data Protection Regulation (GDPR) is to better protect the personal data of European Union “data subjects” – EU citizens and other nationals physically present in the EU at the time data are collected. Visit: https://www.hipaajournal.com/gdpr-training/
The Health Insurance Portability and Accountability Act (HIPAA) was created primarily to modernize the flow of healthcare information, stipulate how Personally Identifiable Information maintained by the healthcare and healthcare insurance industries should be protected from fraud and theft, and address limitations on healthcare insurance coverage – such as portability and the coverage of individuals with pre-existing conditions.