Beware Of Using Get And Set Codes Florida

There is no doubt computer code writing is a tough job, you need to be careful when doing that job. Read the article below to learn tips for using"get" And "set".

Local Companies

MFG/EDP, Inc.
(305) 292-2660
1224 South St.
Key West, FL
Office Management Solutions Inc
813-963-5582
5802 Taywood DR
Tampa, FL
Nextlevel Information Solutions
727-821-7444
700 Central Ave
St. Petersburg, FL
Summit Software Design
727-823-1000
100 2nd Ave S
St. Petersburg, FL
Progressive System Solutions Inc
407-523-7676
4019 Clarcona Ocoee RD
Orlando, FL
Riptide Software
407-384-8818
3452 Lake Lynda Dr
Orlando, FL
Acusoft
407-658-9888
11869 High Tech Ave
Orlando, FL
Gbr Corp
(305) 621-9871
14411 Commerce Way
Hialeah, FL
Keylogger
001-9900000000
Address1 street
Province, FL
Keylogger
001-9900000000
Address1 street
Province, FL

It’s an all-too-common pitfall. Programmers who attempt to write object-oriented code decide to make all of their data variables private, while creating public get() and set() function pairs for each one. “See?” they declare, as they pat themselves on their backs. “The data is private, but it can be accessed through these functions. I’ve encapsulated my data. That’s what object-oriented design requires.”

I think this betrays a fundamental (and exceedingly common) misunderstanding of what constitutes encapsulation and information hiding. Ideally, in an object-oriented design, the user of a software class should have no idea what type of data the class contains. As far as he’s concerned, the class should simply provide the required services, and its internal details should be invisible. However, when we provide get() and set() function pairs for each member variable, we are basically announcing the existence of this data to the world. The information hiding provided by this class is weak—and arguably non-existent. One might change the name, data type or implementation of this member variable, but its existence remains painfully obvious to everyone.

(Note that I say that the user should “ideally” be oblivious to the type of data contained within the class. In practice, this is not always feasible. If we were to implement a BankAccount class, for example, most programmers would immediately guess that this class would have the account balance as one of its data members. They would also guess—rightfully so—that the owner of this account is likely to be data member as well. Nevertheless, we should avoid needlessly divulging such details, especially when the contents of a class are not so easily discerned.)

In effect, these get() and set() member functions are almost as bad as having public data. Sure, they may provide some useful services; for example, the set() function could validate the data, ensuring that it is within the proper range of values. Nevertheless, they tend to violate the spirit of information hiding, at least to some degree.

Using get() and set() functions is not always a bad idea; in fact, sometimes they make perfect sense. Their frequent use, however, is a pretty good indication of a poorly abstracted software design—one that does not adhere well to the principle of information hiding. When designing software classes, we need to think primarily in terms of the services they provide (i.e. their public functions), rather than the data they contain. Ideally, their data implementations should proceed from the required services, rather than other way around.

To illustrate this concept, let us revisit the BankAccount class mentioned earlier. It is clear that the BankAccount object will need to keep track of its balance, so let’s make that a data member. A novice programmer (or one with a poor grasp of object orientation) may choose to provide both GetBalance() and SetBalance() functions for this class… but does this make sense?

What happens when a user attempts to make a deposit? The user would have to call GetBalance(), add the deposit amount, and then set the new value using GetBalance(). That’s not how real users operate, though; in the real world, there is no need for the depositor to know how much money is in the account. This class design gives the user too much information and requires too many steps.

Similarly, to perform a withdrawal, the user would need to call GetBalance(), subtract the withdrawal amount, and then call SetBalance() to update the account. This also requires too much work on the user’s part. In the real world, the user should not always be required to know exactly how much money is in the account. This person might want to know that there are sufficient funds, but he wouldn’t necessarily need to know the precise balance, and this information should not be a constant requirement.

A sensibly written class should provide the following services instead: DepositAmount(), WithdrawAmount() and GetBalance(). With this design, the data member—the account balance—is logically implied by the services provided, rather than the other way around. (We could define other services, such as AccrueInterest() and TransferFunds(), but let’s keep it simple for now. Note that these services might suggest additional data members; for example, AccrueInterest() would suggest that a data member would be needed for the interest rate.)

In summary, get() and set() function pairs are not inherently bad, but their preponderance could suggest a poorly abstracted software design. There’s nothing inherently wrong with using get() and set() functions when they form part of a sensibly designed set of services. Nor is there anything wrong with using a data member to reflect these functions. When one proceeds in the opposite direction, though—when one starts with the data members, then adds corresponding get() and set() pairs—that’s a strong indication of a poorly conceived software design.

About the Author:

V. Berba Velasco Jr., Ph.D. is a senior electrical and software engineer at CTL (http://www.elispot-analyzers.de, http://www.immunospot.com, http://www.elispot.cn, http://www.elispot.co.jp), a biotech firm that provides ELISPOT technology, cryopreserved PBMCs and serum-free media.






Article Source:

thePhantomWriters Article Submission Service

Featured Local Company

MFG/EDP, Inc.

(305) 292-2660
1224 South St.
Key West, FL

Regional Articles
- Beware Of Using Get And Set Codes Altamonte Springs FL
- Beware Of Using Get And Set Codes Apopka FL
- Beware Of Using Get And Set Codes Arcadia FL
- Beware Of Using Get And Set Codes Atlantic Beach FL
- Beware Of Using Get And Set Codes Auburndale FL
- Beware Of Using Get And Set Codes Avon Park FL
- Beware Of Using Get And Set Codes Bartow FL
- Beware Of Using Get And Set Codes Belle Glade FL
- Beware Of Using Get And Set Codes Boca Raton FL
- Beware Of Using Get And Set Codes Bonita Springs FL
- Beware Of Using Get And Set Codes Boynton Beach FL
- Beware Of Using Get And Set Codes Bradenton FL
- Beware Of Using Get And Set Codes Brandon FL
- Beware Of Using Get And Set Codes Brooksville FL
- Beware Of Using Get And Set Codes Cantonment FL
- Beware Of Using Get And Set Codes Cape Coral FL
- Beware Of Using Get And Set Codes Casselberry FL
- Beware Of Using Get And Set Codes Chipley FL
- Beware Of Using Get And Set Codes Clearwater FL
- Beware Of Using Get And Set Codes Clermont FL
- Beware Of Using Get And Set Codes Clewiston FL
- Beware Of Using Get And Set Codes Cocoa Beach FL
- Beware Of Using Get And Set Codes Cocoa FL
- Beware Of Using Get And Set Codes Crawfordville FL
- Beware Of Using Get And Set Codes Crestview FL
- Beware Of Using Get And Set Codes Crystal River FL
- Beware Of Using Get And Set Codes Dade City FL
- Beware Of Using Get And Set Codes Dania FL
- Beware Of Using Get And Set Codes Daytona Beach FL
- Beware Of Using Get And Set Codes Debary FL
- Beware Of Using Get And Set Codes Deerfield Beach FL
- Beware Of Using Get And Set Codes Defuniak Springs FL
- Beware Of Using Get And Set Codes Deland FL
- Beware Of Using Get And Set Codes Delray Beach FL
- Beware Of Using Get And Set Codes Deltona FL
- Beware Of Using Get And Set Codes Destin FL
- Beware Of Using Get And Set Codes Dunedin FL
- Beware Of Using Get And Set Codes Dunnellon FL
- Beware Of Using Get And Set Codes Englewood FL
- Beware Of Using Get And Set Codes Eustis FL
- Beware Of Using Get And Set Codes Fernandina Beach FL
- Beware Of Using Get And Set Codes Fort Lauderdale FL
- Beware Of Using Get And Set Codes Fort Myers FL
- Beware Of Using Get And Set Codes Fort Pierce FL
- Beware Of Using Get And Set Codes Fort Walton Beach FL
- Beware Of Using Get And Set Codes Gainesville FL
- Beware Of Using Get And Set Codes Green Cove Springs FL
- Beware Of Using Get And Set Codes Gulf Breeze FL
- Beware Of Using Get And Set Codes Haines City FL
- Beware Of Using Get And Set Codes Hallandale FL
- Beware Of Using Get And Set Codes Hialeah FL
- Beware Of Using Get And Set Codes Hobe Sound FL
- Beware Of Using Get And Set Codes Holiday FL
- Beware Of Using Get And Set Codes Hollywood FL
- Beware Of Using Get And Set Codes Homestead FL
- Beware Of Using Get And Set Codes Homosassa FL
- Beware Of Using Get And Set Codes Hudson FL
- Beware Of Using Get And Set Codes Immokalee FL
- Beware Of Using Get And Set Codes Inverness FL
- Beware Of Using Get And Set Codes Jacksonville Beach FL
- Beware Of Using Get And Set Codes Jacksonville FL
- Beware Of Using Get And Set Codes Jensen Beach FL
- Beware Of Using Get And Set Codes Jupiter FL
- Beware Of Using Get And Set Codes Key West FL
- Beware Of Using Get And Set Codes Kissimmee FL
- Beware Of Using Get And Set Codes Labelle FL
- Beware Of Using Get And Set Codes Lady Lake FL
- Beware Of Using Get And Set Codes Lake City FL
- Beware Of Using Get And Set Codes Lake Mary FL
- Beware Of Using Get And Set Codes Lake Placid FL
- Beware Of Using Get And Set Codes Lake Wales FL
- Beware Of Using Get And Set Codes Lake Worth FL
- Beware Of Using Get And Set Codes Lakeland FL
- Beware Of Using Get And Set Codes Land O Lakes FL
- Beware Of Using Get And Set Codes Largo FL
- Beware Of Using Get And Set Codes Leesburg FL
- Beware Of Using Get And Set Codes Lehigh Acres FL
- Beware Of Using Get And Set Codes Live Oak FL
- Beware Of Using Get And Set Codes Longwood FL
- Beware Of Using Get And Set Codes Loxahatchee FL
- Beware Of Using Get And Set Codes Lutz FL
- Beware Of Using Get And Set Codes Lynn Haven FL
- Beware Of Using Get And Set Codes Marco Island FL
- Beware Of Using Get And Set Codes Marianna FL
- Beware Of Using Get And Set Codes Melbourne FL
- Beware Of Using Get And Set Codes Merritt Island FL
- Beware Of Using Get And Set Codes Miami Beach FL
- Beware Of Using Get And Set Codes Miami FL
- Beware Of Using Get And Set Codes Miami Lakes FL
- Beware Of Using Get And Set Codes Middleburg FL
- Beware Of Using Get And Set Codes Milton FL
- Beware Of Using Get And Set Codes Miramar FL
- Beware Of Using Get And Set Codes Mount Dora FL
- Beware Of Using Get And Set Codes Mulberry FL
- Beware Of Using Get And Set Codes Naples FL
- Beware Of Using Get And Set Codes Navarre FL
- Beware Of Using Get And Set Codes New Port Richey FL
- Beware Of Using Get And Set Codes New Smyrna Beach FL
- Beware Of Using Get And Set Codes Niceville FL
- Beware Of Using Get And Set Codes Nokomis FL
- Beware Of Using Get And Set Codes North Fort Myers FL
- Beware Of Using Get And Set Codes North Miami Beach FL
- Beware Of Using Get And Set Codes North Palm Beach FL
- Beware Of Using Get And Set Codes North Port FL
- Beware Of Using Get And Set Codes Ocala FL
- Beware Of Using Get And Set Codes Ocoee FL
- Beware Of Using Get And Set Codes Okeechobee FL
- Beware Of Using Get And Set Codes Oldsmar FL
- Beware Of Using Get And Set Codes Opa Locka FL
- Beware Of Using Get And Set Codes Orange City FL
- Beware Of Using Get And Set Codes Orange Park FL
- Beware Of Using Get And Set Codes Orlando FL
- Beware Of Using Get And Set Codes Ormond Beach FL
- Beware Of Using Get And Set Codes Oviedo FL
- Beware Of Using Get And Set Codes Palatka FL
- Beware Of Using Get And Set Codes Palm Bay FL
- Beware Of Using Get And Set Codes Palm Beach FL
- Beware Of Using Get And Set Codes Palm Beach Gardens FL
- Beware Of Using Get And Set Codes Palm City FL
- Beware Of Using Get And Set Codes Palm Coast FL
- Beware Of Using Get And Set Codes Palm Harbor FL
- Beware Of Using Get And Set Codes Palmetto FL
- Beware Of Using Get And Set Codes Panama City Beach FL
- Beware Of Using Get And Set Codes Panama City FL
- Beware Of Using Get And Set Codes Pembroke Pines FL
- Beware Of Using Get And Set Codes Pensacola FL
- Beware Of Using Get And Set Codes Pinellas Park FL
- Beware Of Using Get And Set Codes Plant City FL
- Beware Of Using Get And Set Codes Pompano Beach FL
- Beware Of Using Get And Set Codes Ponte Vedra Beach FL
- Beware Of Using Get And Set Codes Port Charlotte FL
- Beware Of Using Get And Set Codes Port Orange FL
- Beware Of Using Get And Set Codes Port Richey FL
- Beware Of Using Get And Set Codes Port Saint Lucie FL
- Beware Of Using Get And Set Codes Punta Gorda FL
- Beware Of Using Get And Set Codes Riverview FL
- Beware Of Using Get And Set Codes Rockledge FL
- Beware Of Using Get And Set Codes Safety Harbor FL
- Beware Of Using Get And Set Codes Saint Augustine FL
- Beware Of Using Get And Set Codes Saint Cloud FL
- Beware Of Using Get And Set Codes Saint Petersburg FL
- Beware Of Using Get And Set Codes Sanford FL
- Beware Of Using Get And Set Codes Sarasota FL
- Beware Of Using Get And Set Codes Satellite Beach FL
- Beware Of Using Get And Set Codes Sebastian FL
- Beware Of Using Get And Set Codes Sebring FL
- Beware Of Using Get And Set Codes Seffner FL
- Beware Of Using Get And Set Codes Seminole FL
- Beware Of Using Get And Set Codes Spring Hill FL
- Beware Of Using Get And Set Codes Starke FL
- Beware Of Using Get And Set Codes Stuart FL
- Beware Of Using Get And Set Codes Summerfield FL
- Beware Of Using Get And Set Codes Sun City Center FL
- Beware Of Using Get And Set Codes Tallahassee FL
- Beware Of Using Get And Set Codes Tampa FL
- Beware Of Using Get And Set Codes Tarpon Springs FL
- Beware Of Using Get And Set Codes Titusville FL
- Beware Of Using Get And Set Codes Valrico FL
- Beware Of Using Get And Set Codes Venice FL
- Beware Of Using Get And Set Codes Vero Beach FL
- Beware Of Using Get And Set Codes Wauchula FL
- Beware Of Using Get And Set Codes Wesley Chapel FL
- Beware Of Using Get And Set Codes West Palm Beach FL
- Beware Of Using Get And Set Codes Winter Garden FL
- Beware Of Using Get And Set Codes Winter Haven FL
- Beware Of Using Get And Set Codes Winter Park FL
- Beware Of Using Get And Set Codes Winter Springs FL
- Beware Of Using Get And Set Codes Zephyrhills FL
Related Articles
- Beating Spyware Florida
Spyware spread quickly across the internet world forcing users to become aware of the prevalent threats facing their privacy while surfing the internet. Spyware collects information on you internet and computer usage habits as well as more serious information including personal identification and credit card numbers.
- Regarding dumb Smart Folders Florida
- Antivirus And Security Florida
- Using Lookup Tables in AppleWorks Florida
- CMMS Implementation Florida
- How To Build A Flash Game Florida
- DVD ripping FAQ Florida
- Bioinformatics Introduction Florida
- Win PC Defender Florida
- Printing Software in Business Florida
Related Local Events
PWC EXCEL-erated Program
Dates: 12/8/2009 - 12/8/2009
Location: Hotel Indigo – Deerwood
Jacksonville, FL
View Details

SCORE Business Counseling
Dates: 12/9/2009 - 12/9/2009
Location: The Chamber Office
Coral Springs, FL
View Details

PERFORMANCE RACING INDUSTRY SHOW 2009
Dates: 12/10/2009 - 12/12/2009
Location: Orange County Convention Center
Orlando, FL
View Details

Wake Up Coral Springs Breakfast!!
Dates: 12/15/2009 - 12/15/2009
Location: Marriott Heron Bay
Coral Springs, FL
View Details

Wednesday Evening Referral Group
Dates: 12/16/2009 - 12/16/2009
Location: WineStyles
Coral Springs, FL
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Advertising Family Home Services Real Estate Resources
Business Services Fashion Industrial Goods & Services Retail & Consumer Services
Career Financial Services Insurance Software
Cars Food & Beverage Internet Technology
Computer Hardware Franchise Legal Telecommunications
Construction Health Miscellaneous Trade Shows
Education Holidays Nightlife Travel
Entertainment Home Appliances Online Database Weddings
Environmental Home Electronics Pets World History