Thursday, July 21, 2016

What is Framework?



















A Framework, or computer code framework, may be a platform for developing computer code applications. It provides a foundation on that computer code developers will build programs for a specificplatform. maybe, a framework might embrace predefined categories and functions which will be wont to method input, manage hardware devices, and move with system computer code. This streamlines the event method since programmers do not ought to reinvent the wheel when they develop a replacement application.

A framework Associate in Nursingalogous is comparable to an application programming interface (API), tho' technically a framework includes AN API. because the name suggests, a framework is a foundation for programming, whereas AN API provides access to the weather supported by the framework. A framework may additionally  embrace code libraries, a compiler, and alternative programs utilized in the computer code development method.

Several differing types of computer code frameworks exist. well-liked examples embrace ActiveXand .NET for Windows development, Cocoa for macintosh OS X, Cocoa bit for iOS, and therefore the robot Application Framework for robot. computer code development kits (SDKs) ar offered for every of those frameworks and embrace programming tools designed specifically for the corresponding framework. maybe, Apple's Xcode development computer code includes a macintosh OS X SDK designed for writing and aggregation applications for the Cocoa framework.

In several cases, a computer code framework is supported natively by AN package. maybe, a program written for the robot Application Framework can run on AN robot device while not requiring alternative further files to be put in. However, some applications need a particular framework so as to run. maybe, a Windows program might need Microsoft .NET Framework four.0, that isn't put in on all Windows machines (especially PCs running older versions of Windows). during this case, the Microsoft .NET Framework four installer package should be put in so as for the program to run.

NOTE: whereas frameworks typically consult with broad computer code development platforms, the term can even be wont to describe a particular framework inside a bigger programming setting. maybe, multiple Java frameworks, adore Spring, ZK, and therefore the Java Collections Framework (JCF) will be wont to produce Java programs. to boot, Apple has created many specific frameworks which will be accessed by OS X programs. These frameworks ar saved with a .FRAMEWORK file extension and ar put in in the/System/Library/Frameworks directory. samples of OS X frameworks includeAddress Book.framework, CoreAudio.framework, CoreText.framework, and QuickTime.framework.

What is a Computer Code Framework? And why do you have to like EM?

The purpose of a framework is to boost the potency of making new computer code.  Frameworks will improve developer productivity and improve the standard, dependability and hardiness of recent computer code.  Developer productivity is improved by permitting developers to target the distinctive necessities of their application rather than defrayal time on application infrastructure (“plumbing").
Many people equate the term computer code framework with AN object-oriented computer code library, or set of libraries, supposed to produce recycle.  However, there's a very important distinction between a framework and a library, that distinction is commonly referred to as “inversion of management.”  If you’re employing a library, the objects and strategies enforced by the library ar instantiated and invoked by your custom application. you wish to grasp that objects to instantiate and that strategies to decision so as to attain your goals.  On the opposite hand, if you’re employing a framework, you implement the objects and strategies that ar custom to your application and that they ar instantiated and invoked by the framework.  A framework defines the flow of management for the applying.

A common thanks to customise framework behavior is to override framework-implemented options. The abstract or virtual strategies outlined by framework categories will be overridden in user-defined code. New objects will be created that implement framework-defined interfaces. These approaches leverage polymorphism to permit one computer code, the framework, to move with computer code developed by another cluster.

To emphasize the purpose, let’s scrutinize a grossly simplistic example. The Windows Presentation Foundation (WPF) may be a framework for building Windows applications. to form a replacement Windows application with WPF there ar 2 essential components. the primary may be a XAML file. The XAML file describes the configurable attributes of the applying including: that categories to instantiate, values for object properties, and that strategies to invoke in response to user activity. the subsequent may be a terribly straightforward example of a XAML file:

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Title="Window1" Height="300" Width="300">
<Grid>                                     
<Button Name="button1" Click="button1_Click">Button</Button>
</Grid>

</Window>

This sample describes a Window which will be instantiated by the applying. Application-specific logic for this window is found in a very category named WpfApplication1.Window1. The sample describes the way to label the window and therefore the initial size of the window. The window contains a Grid management that successively contains a Button management. The attributes of theButton management tell WPF to invoke the WpfApplication.Window1 methodology named button1_Click once the button is clicked by a user.

The second essential part of a WPF application is code. the subsequent may be a straightforward example:

namespace WpfApplication1
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}

private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello world.");
}
}

}

This snipping is comfortable to implement a Windows application. The framework’s "inversion of control" is pictured by the button1_Click methodology. This methodology is invoked by the framework once the user clicks on the button. The framework defines much everything that happens once this application is executed; the Window1 category defines solely the application-specific behavior. No cryptography is required to show the window, method user input, or handle any common window operations (e.g. move, resize, minimize, maximize, close). Compare this sample with the quantity of code that will be required to develop even a straightforward application like this one while not a framework. several organizations develop Windows applications; few sleep with from scratch.

Now extend the framework construct from the general to a particular application domain (e.g. instrumentality automation). A domain-specific framework permits new domain applications to be developed a lot of quickly, with top quality, and permits developers to focus their attention on the distinctive necessities of their application or system. Imagine configuring a replacement instrumentality management answer victimization framework-implemented building blocks and implementing solely the overrides that ar distinctive to your system.

Those overrides might embrace components of method management, human machine interface, knowledge assortment and analysis, formula management, material handling, etc. nowadays there ar several organizations that develop individual instrumentality automation solutions from scratch. A team victimization anequipment automation framework, adore CIM Control Framework™, might (for example) focus their time on the way to execute a method formula rather than worrying regarding however recipes ar hold on, retrieved, organized, protected, uploaded, downloaded, or communicated to the method instrumentality.

Advantages:

Reuse code that has been pre-built and pre-tested. Increase the dependability of the new application and cut back the programming and testing effort, and time to promote.
A framework will facilitate establish higher programming practices and applicable use of style patterns and new programming tools. A framework upgrade will offer new practicality, improved performance, or improved quality while not further programming by the framework user.
By definition, a framework provides you with the means that to increase its behavior.

Disadvantages:

Creating a framework is troublesome and long (i.e. expensive).
The learning curve for a replacement framework will be steep.
Over time, a framework will become more and more advanced...