Smart variables

Smart variables

SmartVariables is a term introduced in 1998 referring to a design pattern that merges networking and distributed object technology with the goal of reducing complexity by transparently sharing information at the working program variable level. [cite conference|first=Brian|last=Foote|coauthors=Joseph Yoder|title=Metadata and Active Object-Models|booktitle=Pattern Languages of Programs Conference|year=1998|url=http://jerry.cs.uiuc.edu/~plop/plop98/final_submissions — Introduced the concept of "smart variables".]

SmartVariables style programming interfaces emulate simple "network shared memory." The design emphasis is API simplicity for systems needing to exchange information. Sharing and update behaviors do not need to be explicitly programmed; however "callbacks" can be attached that execute when a "named" object's content changes. SmartVariables attach an email-like "name" to each container or list; when the variable changes value, it automatically propagates change events across the network into other running processes working with that data. Applications do not poll for content changes, as events get processed asynchronously — working program variables simply receive new content. [cite paper | author=Hounshell, Lee | title=Simplifying Web Infrastructure with SmartVariables | publisher=SmartVariables.com | date=March 2006 | format=pdf| url=http://www.smartvariables.com/doc/DistributedProgramming.pdf — Refined and extended the concept, using "smart variables" to simplify Grid computing and implement web services, directory, and distributed neural networks.]

The concept has some similarities to that of stored procedures and triggers in database systems, where a change to one item can set off other changes in the database.

Programming Basics

This C++ example is from the GPL open-source SmartVariables implementation at SmartVariables.com.Imagine an environment with three networked computers named: Alice, Bob and Charlie.To begin, our program running on “Alice” will function to continuously print out thecontents of a remote container object named “greeting@Charlie.” Here is the code for Alice:

Var greeting; greeting.Name( “greeting@Charlie” ); // attach to and subscribe to the remote object while (1) { cout << “greeting=” << greeting << endl; // note that ‘greeting’ can change values here }

Note that Alice’s display code is in a tight-loop, and there is no code that explicitly connects tomachine “Charlie” to retrieve the “greeting” object or any changes made to it. Next, we run anotherprogram on machine “Bob” that simply changes the value of the remote “greeting@Charlie” objectto be the string “Hello, World!.” Here is the code for Bob:

Var greeting = “Hello, World!”; greeting.Name( “greeting@Charlie” ); // modify all copies, everywhere.

Now, when the above program on machine Bob gets executed, it transparently connects to Charlieand modifies the “greeting” object to have its new value: “Hello, World!.” Because SmartVariablescontainers “know” who have copies of their data, the environment transparently propagates thechange to Alice. SmartVariables propagate themselves into process-level code automatically. Thismeans that the program still looping on Alice will now begin printing its new value of “Hello, World!.”The code on Alice appears to be a “tight loop,” with no opportunity for the object to be modified;however, it does change. Modifications to the “greeting@Charlie” object become automaticallyreflected by Alice’s program output. This behavior is quite amazing to see.

References

External links

* [http://smartvariables.com Open source commercial implementation (beta) in C++] .


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Smart grid — Public infrastructure …   Wikipedia

  • Smart room — Una Smart Room se define como una sala inteligente. Es una sala equipada con equipos que recogen información sobre las personas que se encuentran en su interior,analizan los datos recibidos e interactúan con el usuario. Este tipo de salas están… …   Wikipedia Español

  • Smart objects — In [Marcelo Kallman, Daniel Thalmann: Modeling Objects for Interaction Tasks ] a Smart Object is described as a special case of an object in a virtual environment that can describe its own possible interactions.The opposite approach to Smart… …   Wikipedia

  • Dolphin smart community script — Infobox Software name = Dolphin Smart Community Builder latest stable release version = 6.1 operating system = Linux/Unix/Windows platform = Apache Web Server, PHP 4.3.6 and higher compiled with XML and XSLT support, MySQL 4.0.20 and higher genre …   Wikipedia

  • Comparison of programming languages (mapping) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • C++0x — is the planned new standard for the C++ programming language. It is intended to replace the existing C++ standard, ISO/IEC 14882, which was published in 1998 and updated in 2003. These predecessors are informally known as C++98 and C++03. The new …   Wikipedia

  • C++11 — C++11, also formerly known as C++0x,[1] is the name of the most recent iteration of the C++ programming language, replacing C++TR1, approved by the ISO as of 12 August 2011.[2] The name is derived from the tradition of naming language versions by …   Wikipedia

  • Java Card — est un environnement d exécution Java destiné aux applications pour Carte à puce. Cette technologie fournit un environnement sécurisé pour les applications qui fonctionnent sur ce support de capacité mémoire et de traitement limitées. De… …   Wikipédia en Français

  • Pointer (computing) — This article is about the programming data type. For the input interface (for example a computer mouse), see Pointing device. Pointer a pointing to the memory address associated with variable b. Note that in this particular diagram, the computing …   Wikipedia

  • Comparison of Java and C++ — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”