CallBack in Computer Science

In computer programming, a callback is executable code that is passed as an argument. It allows a lower-level software layer to call a subroutine (or function) defined in a higher-level layer

The form of a callback varies among programming languages.
C and C++ allow function pointers as arguments to other functions.

Several programming languages (though especially functional programming languages such as Scheme or ML) allow closures, a generalization of function pointers, as arguments to other functions.

In object-oriented programming languages, a call can accept an object that implements some abstract interface, without specifying in detail how the object should do so. The programmer who implements that object may use the interface’s methods exclusively for application-specific code. Such objects are effectively a bundle of callbacks, plus the data they need to manipulate. They are useful in implementing various design patternsVisitor, Observer, and Strategy.

C++ allows objects to provide their own implementation of the function call operation. The Standard Template Library accepts these objects (called functors), as well as function pointers, as parameters to various polymorphic algorithms

C# .NET Framework provides a type-safe encapsulating reference, a ‘delegate’, to manage function pointers. These can be used for callback operations.

Perl supports subroutine references.

Some systems have built-in programming languages to support extension and adaptation. These languages provide callbacks without the need for separate software development tools

For more details and Info Visit Link Below

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s