General Assignment and Mutator Helper Functions

General Assignment and Mutator Helper Functions

For access to this article, please select a purchase option:

Buy chapter PDF
(plus tax if applicable)
Buy Knowledge Pack
10 chapters for £75.00
(plus taxes if applicable)

IET members benefit from discounts to all IET publications and free access to E&T Magazine. If you are an IET member, log in to your account and the discounts will automatically be applied.

Learn more about IET membership 

Recommend Title Publication to library

You must fill out fields marked with: *

Librarian details
Your details
Why are you recommending this title?
Select reason:
A Guide to MATLAB® Object-Oriented Programming — Recommend this title to your library

Thank you

Your recommendation has been sent to your librarian.

In the constant quest for software quality, consistent interfaces and modular code are very important. In light of this, there is a need to turn attention on get and set. If you examine the current implementations of get or set, the logic in almost every case statement is different. These differences are currently necessary because the interface for each public variable is unique. It is preferable to keep the group-of-eight functions as uniform as possible and that means trying to move interface differences out of get and set. A helper-function technique is developed that pushes most of the differences out of get and set and into the helper. This technique will improve code modularity and improvements in modularity directly relate to improvements in code quality. As always, the driving force is code quality. As the public interface grows in complexity, it would be bad if the complexity of get and set grew faster than the interface.

Chapter Contents:

  • 16.1 Helper Function Strategy
  • 16.1.1 Direct-Link Public Variables
  • get and subsref
  • set and subsasgn
  • 16.1.2 get and set Helper Functions
  • Helper functions, get, and set
  • Final template for get.m
  • Final Template for set.m
  • Color Helper Function
  • The Other Classes and Member Functions
  • 16.2 Test Drive
  • 16.3 Summary
  • 16.4 Independent Investigations

Inspec keywords: object-oriented methods; software quality

Other keywords: software quality; group-of-eight function; get function; set function; code quality; mutator helper function; helper-function technique; code modularity

Subjects: Software engineering techniques; Object-oriented programming

Preview this chapter:
Zoom in

General Assignment and Mutator Helper Functions, Page 1 of 2

| /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch16-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch16-2.gif

Related content

This is a required field
Please enter a valid email address