Function

Submitted by: Submitted by

Views: 94

Words: 2407

Pages: 10

Category: Other Topics

Date Submitted: 08/05/2014 08:13 AM

Report This Essay

FUNCTIONS

Functions are "self contained" modules of code that accomplish a specific task. Functions usually "take in" data, process it, and "return" a result. Once a function is written, it can be used over and over and over again. Functions can be "called" from the inside of other functions.

Functions "Encapsulate" a task (they combine many instructions into a single line of code). Most programming languages provide many built in functions that would otherwise require many steps to accomplish, for example computing the square root of a number. In general, we don't care how a function does what it does, only that it "does it"!

CONFIGURATION

The way a system is set up, or the assortment of components that make up the system. Configuration can refer to either hardware orsoftware, or the combination of both. For instance, a typical configuration for a PC consists of 32MB (megabytes) main memory, a floppy drive, a hard disk, a modem, a CD-ROM drive, aVGA monitor, and the Windows operating system.

Many software products require that the computer have a certainminimum configuration. For example, the software might require agraphics display monitor and a video adapter, a particularmicroprocessor, and a minimum amount of main memory.

When you install a new device or program, you sometimes need toconfigure it, which means to set various switches and jumpers (for hardware) and to define values of parameters (for software). For example, the device or program may need to know what type of video adapter you have and what type of printer is connected to the computer. Thanks to new technologies, such as plug-and-play, much of this configuration is performed automatically.

INTERACTION

The interaction is "what the system does." The interaction is implemented as Roles which are played by objects at run time. These objects combine the state and methods of a data (domain) object with methods (but no state, as Roles are stateless) from one or more Roles. In good DCI style, a...