Thursday, May 27, 2010

Software Frameworks

(Courtesy: Wikipedia) A software framework, in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined Application programming interface (API), yet they contain some key distinguishing features that separate them from normal libraries.

Software frameworks have these distinguishing features that separate them from libraries or normal user applications:

  1. Inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework.[1]
  2. Default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops.
  3. Extensibility - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality.
  4. Non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.
(Courtesy: Wantii) A Framework is similar to an API because it is used to accomplish a set of tasks within a project without spending time creating reusable components from scratch. What separates a framework from an API is size and scope. Most APIs are devoted to accomplishing a single task or implementing one protocol. Frameworks often provide facilities to manage much more complicated problems such as allowing a consistent code style within a large project, or providing a consistent look-and-feel within a large GUI-based project. A framework will often include related resources such as graphical elements or UI widgets to help the developers using the framework.

No comments: