INFO-LINK



C/C++

Double Dispatch Revisited


Jan04: Double Dispatch Revisited

Nat is a product architect at CogniToy LLC. He can be contacted at nat@cognitoy.com.


Item 31 of Scott Meyers's book More Effective C++ (Addison-Wesley, 1996) discusses the problem of making a C++ function virtual on more than one of its arguments. To paraphrase Meyers's example: Say you're writing a simple game program set in space, using a collection of polymorphic GameObjects: SpaceShip, SpaceStation, and Asteroid, that move around and sometimes collide. Clearly, it matters a great deal which two objects are colliding. An Asteroid colliding with a SpaceShip might do major damage, whereas a low-speed collision between a SpaceShip and a SpaceStation could be regarded as a successful attempt to dock. So when you discover that two GameObjects are colliding, how should you invoke the appropriate code to process the collision?

Meyers presents—and dismisses—a couple of obvious, but unfortunate, approaches: using the C++ virtual-function machinery on each argument and writing a series of if statements that test runtime type information (RTTI) from typeid(). From a maintenance perspective, each of these is far too similar to the dreaded "Big Switch Statement."

Instead, he suggests the clever technique of initially using typeid(type).name() on each argument type to obtain a distinct string, and building a map<pair<string, string>, function_ptr> to register each processing function. Then, given a pair of actual arguments, Meyers uses typeid(reference).name() on each argument to get the strings with which to perform a map lookup.

He points out that there is a drawback to this technique—it doesn't deal with inheritance. In his example, there's a registered processing function, shipAsteroid(), that expects actual parameters (SpaceShip, Asteroid). If you derive CommercialShip and MilitaryShip from SpaceShip, you might expect that when a MilitaryShip collides with an Asteroid, you'd call shipAsteroid() as before. Alas, it doesn't work that way. "Even though a MilitaryShip can be treated like a SpaceShip," notes Meyers, "lookup() has no way of knowing that. Furthermore, there is no easy way of telling it."

In Modern C++ Design: Generic Programming and Design Patterns Applied (Addison-Wesley, 2001), Andrei Alexandrescu also discusses multiple dispatch. "I am convinced," he writes, "there is a solution to the inheritance problem. But, alas, writers of books have deadlines, too."

I am indebted to both writers for most of what follows. I have found that with a somewhat different container, you can get reasonably good results.

Consider a small class (Listing One) to represent an arbitrary pair of GameObject subclass types. You can define a subclass to represent the types (SpaceShip, Asteroid) as in Listing Two, where you take advantage of dynamic_cast to do the type matching. It's important to work with pointers because dynamic_cast produces a zero pointer if the actual object in question cannot be downcast to the specified pointer type.

When you generalize that subclass (as in Listing Three), you just construct a container of such objects and search that. The important point is that, even for a subclass object myMilitaryShip, dynamic_cast<const SpaceShip*> produces a nonzero pointer. The catch is that this test is ambiguous. You still have the general-purpose processing function shipAsteroid(SpaceShip&, Asteroid&)—but suppose that MilitaryShips get special treatment (maybe they're more heavily armored) and need a special routine such as militaryShipAsteroid(MilitaryShip&, Asteroid&). Every MilitaryShip object actually matches both routines, so this registry can't rely on unique lookup.

The problem resembles catching an exception of a particular type. Suppose you have an Error base class with a subclass ErrorRuntime, which in turn has a subclass ErrorBounds. You could write incorrect code like that in Listing Four where, if dubiousRoutine() throws an ErrorBounds exception, it will not be caught by the ErrorBounds clause. Every ErrorBounds object is an ErrorRuntime as well, so that exception will be caught by the ErrorRuntime clause instead. To distinguish between ErrorBounds and all other ErrorRuntime exceptions, the classes in question must be written like Listing Five.

In the same spirit, you can construct a sequence container (a list) of EntryBase objects and perform a linear search. Invoke the first Entry for which matches() returns true—thus, the burden is on you to populate the list in a reasonable order.

Naturally, you can't just construct a list<EntryBase>: That would slice every Entry subclass object, which is hardly what you want. To be properly polymorphic, your list must store pointers to EntryBase. But that raises uncomfortable questions about the life span of the EntryBase objects: When the list is destroyed, what happens to all of those objects?

This is what smart pointers are all about. std::auto_ptr can't be used in STL containers. But the Boost Library (http://www .boost.org/) provides a couple of varieties of smart pointers, and boost::shared_ptr seems ideal for the job. For convenience, I'll typedef boost::shared_ptr<EntryBase> as EntryPtr.

The container, then, is a list<EntryPtr>; see Listing Six. How will you actually search it? Well, you'll be called with two specific GameObject (subclass) references, as in Listing Seven.

boost::bind() is so cool that it deserves more discussion than I can give it here. For our purposes, the boost::bind() syntax in Listing Seven essentially says: For each item in mDispatch, call matches(param1, param2), and stop when it returns true. boost::bind() automatically handles the fact that the items in mDispatch are smart pointers, as well as the fact that matches() is actually a member function of the referenced class.

Once we've found the right EntryPtr, calling it isn't hard. You must bind some sort of function or function object (called a "functor"); see Listing Eight. Any class with an operator() method accepting two GameObject& parameters works.

Since each Entry subclass already knows its Functor's parameter types, you can also equip it with a virtual method to perform the appropriate downcasting, as in Listing Nine. Therefore, you can provide a function like Listing Ten. This lets you code each Functor using the specific GameObject subclasses that it expects to process. For example, you can write shipAsteroid(SpaceShip&, Asteroid&) rather than shipAsteroid(GameObject&, GameObject&) with internal downcasts.

All that remains is to populate the DispatchTable. You want to provide a function to append new Entry objects to the existing container. Naturally, since this function must instantiate a template class, it must be a template function.

The template function must accept two "types" as well as a Functor. While it should be possible to provide those types as explicit template parameters (for example, add<SpaceShip, Asteroid>(shipAsteroid)), the Microsoft Visual C++ 6 compiler (to name one example) doesn't support that construct.

But you can borrow again from Alexandrescu and wrap these types as lightweight objects:

template<typename T>

struct Type {};

This lets you pass these types to the template function as extra parameters; see Listing Eleven. Then, as both Meyers and Alexandrescu suggest, you can add support for symmetry. Your collision-detection algorithm might turn up a given pair of colliding GameObjects in either order, (SpaceShip, Asteroid) or (Asteroid, SpaceShip). You don't want your collision-processing code to have to be sensitive to that.

Listing Twelve shows an add() function that supports inserting symmetrical Entry objects. This usage of boost::bind() simply reverses the Functor's actual arguments. Having symmetrical entries in the registry lets you write Listing Thirteen without worrying about whether the collision pair was actually detected as (Asteroid, SpaceShip). Both cases are handled by the same code.

I generalized the resulting DoubleDispatch class (available electronically; see "Resource Center," page 7) as a template so that you need not constrain the client to use a specific parameter base class—or a specific return type for the registered functions.

To illustrate how you can use this class, I've included a test program (also available electronically).

The excerpt in Listing Fourteen shows the calls that instantiate and populate the dispatcher, along with some hardcoded test collisions. That program produces the output in Listing Fifteen.

A number of refinements are possible:

  • It would be useful to be able to erase() a specific Entry from the DoubleDispatch table. This is relatively straightforward: The Entry template class can capture its parameter types' typeid() values and implement an operator==() method that compares them directly. I wanted to avoid cluttering this discussion with that mechanism, though; the lookup and dispatch code does not depend on typeid() comparisons.
  • Not every C++ compiler accepts void as the ReturnType template parameter because of the constructs shown in Listing Sixteen. There's template magic you can use to address that, but for present purposes, it only obscures the code.

  • A more serious limitation is the need to register processing functions in a specific order. That implies that all registration calls are made by a central piece of code, which means that adding new GameObject subclasses requires maintaining that code.

I've also built a Java variation on DoubleDispatch (available electronically) where you need not break out EntryBase and Entry: Each Entry simply references the Class objects representing its two parameter types. And given the Class.isAssignableFrom(Class) method, I built an Entry.shouldPrecede(Entry) method that permits DoubleDispatch.add() to search the existing list for a good place to insert the new Entry. So in Java, you can call DoubleDispatch.add() to register new processing routines from many places in your program.

I would like to do the same in C++, but it's hard to compare two Entry template objects constructed at different times. I want to be able to examine the class types embedded in each Entry object to discover inheritance relationships—but I know of no way to do that without actually attempting to instantiate an object of one of the parameter types, which seems like a bad idea.

It's worth noting that Alexandrescu describes template magic that you can use to discover the inheritance relationship between two classes. To do that, however, both class types must be available at the same point in the code. And if you're willing to stipulate that the relevant types must all be available at the same place, then you don't need to extend DoubleDispatch because you can simply write the add() calls in an appropriate order.

DDJ

Listing One

class EntryBase
{
public:
virtual bool matches(const GameObject& param1,
const GameObject& param2) const = 0;
};
Back to Article

Listing Two

class Entry: public EntryBase
{
public:
virtual bool matches(const GameObject& param1,
const GameObject& param2) const
{
return (dynamic_cast<const SpaceShip*>(&param1) != 0 &&
dynamic_cast<const Asteroid*>(&param2) != 0);
}
};
Back to Article

Listing Three

template<typename Type1, typename Type2>
class Entry: public EntryBase
{
public:
virtual bool matches(const GameObject& param1,
const GameObject& param2) const
{
return (dynamic_cast<const Type1*>(&param1) != 0 &&
dynamic_cast<const Type2*>(&param2) != 0);
}
};
Back to Article

Listing Four

try
{
dubiousRoutine();
}
catch (const ErrorRuntime& e)
{
...
}
catch (const ErrorBounds& e) // whoops, never reached!
{
...
}
catch (const Error& e)
{
...
}
Back to Article

Listing Five

try
{
dubiousRoutine();
}
catch (const ErrorBounds& e) // better
{
...
}
catch (const ErrorRuntime& e)
{
...
}
catch (const Error& e)
{
...
}
Back to Article

Listing Six

typedef boost::shared_ptr<EntryBase> as EntryPtr;
typedef std::list<EntryPtr> DispatchTable;
DispatchTable mDispatch;
Back to Article

Listing Seven

// Look up the first matching entry.
EntryPtr lookup(const GameObject& param1, const GameObject& param2) const
{
DispatchTable::const_iterator found =
std::find_if(mDispatch.begin(), mDispatch.end(),
boost::bind(&EntryBase::matches, _1,
boost::ref(param1), boost::ref(param2)));
if (found != mDispatch.end())
return *found;
return 0;
}
Back to Article

Listing Eight

template<typename Type1, typename Type2, class Functor>
class Entry: public EntryBase
{
// Bind whatever function or function object the instantiator passed.
Functor mFunc;
public:
Entry(Functor func): mFunc(func) {}
virtual bool matches(const GameObject& param1,
const GameObject& param2) const { ... }
};
Back to Article

Listing Nine

class EntryBase
{
public:
...
virtual void operator()(GameObject& param1,
GameObject& param2) const = 0;
};
template<typename Type1, typename Type2, class Functor>
class Entry: public EntryBase
{
Functor mFunc;
public:
Entry(Functor func): mFunc(func) {}
...
virtual void operator()(GameObject& param1,
GameObject& param2) const
{
mFunc(dynamic_cast<Type1&>(param1),
dynamic_cast<Type2&>(param2));
}
};
Back to Article

Listing Ten

void call(GameObject& param1, GameObject& param2) const
{
EntryPtr found = lookup(param1, param2);
if (found.get() == 0)
return; 
(*found)(param1, param2); // call the Functor we found
}
Back to Article

Listing Eleven

template<typename Type1, typename Type2, class Functor>
void insert(const Type<Type1>&, const Type<Type2>&, Functor func)
{
mDispatch.insert(mDispatch.end(),
EntryPtr(new Entry<Type1, Type2, Functor>(func)));
}
Back to Article

Listing Twelve

template<typename Type1, typename Type2, class Functor>
void add(const Type<Type1>& t1, const Type<Type2>& t2, Functor func,
bool symmetrical = false)
{
insert(t1, t2, func);
if (symmetrical)
insert(t2, t1, boost::bind(func, _2, _1));
}
Back to Article

Listing Thirteen

void shipAsteroid(SpaceShip& ship, Asteroid& rock)
{
cout << rock.stringize() << " has pulverized " << ship.stringize() << endl;
}
Back to Article

Listing Fourteen

typedef DoubleDispatch<int, GameObject> DD;
DD dispatcher;
dispatcher.add(DD::Type<SpaceShip>(), DD::Type<Asteroid>(),
shipAsteroid, true);
dispatcher.add(DD::Type<SpaceShip>(), DD::Type<SpaceStation>(),
shipStation, true);
dispatcher.add(DD::Type<Asteroid>(), DD::Type<SpaceStation>(),
asteroidStation, true);
// Instantiate a few GameObjects. Make sure we refer to them
// polymorphically, and don't let them leak.
std::auto_ptr<GameObject> home(new SpaceStation("Terra Station"));
std::auto_ptr<GameObject> obstacle(new Asteroid("Ganymede"));
std::auto_ptr<GameObject> tug(new CommercialShip("Pilotfish"));
std::auto_ptr<GameObject> patrol(new MilitaryShip("Enterprise"));
// Try colliding them.
dispatcher(*home, *tug); // reverse params, SpaceShip subclass
dispatcher(*patrol, *home); // forward params, SpaceShip subclass
dispatcher(*obstacle, *home); // forward params
dispatcher(*home, *obstacle); // reverse params
dispatcher(*tug, *obstacle); // forward params, SpaceShip subclass
dispatcher(*obstacle, *patrol); // reverse params, SpaceShip subclass
Back to Article

Listing Fifteen

class CommercialShip Pilotfish has docked at class SpaceStation Terra Station
class MilitaryShip Enterprise has docked at class SpaceStation Terra Station
class Asteroid Ganymede has damaged class SpaceStation Terra Station
class Asteroid Ganymede has damaged class SpaceStation Terra Station
class Asteroid Ganymede has pulverized class CommercialShip Pilotfish
class Asteroid Ganymede has pulverized class MilitaryShip Enterprise
Back to Article

Listing Sixteen

ReturnType operator()(ParamBaseType& param1, ParamBaseType& param2) const
{
EntryPtr found = lookup(param1, param2);
if (found.get() == 0)
return ReturnType(); // return void() ?!?
return (*found)(param1, param2); //return (value returned by void function)
}

Back to Article


Around the Web

CoreDet: A Compiler and Runtime System for Deterministic Multithreaded Execution

CoreDet is a fully automatic compiler and runtime system for deterministic execution of arbitrary C/C++ multithreaded programs.

Quick Read

Honeypot Detection in Advanced Botnet Attacks

Honeypots have been successfully deployed in many computer security defense systems.

Quick Read

Swarm: A True Distributed Programming Language

The Swarm prototype is a simple stack-based language, akin to a primitive version of the Java bytecode interpreter.

Quick Read

Key Software Development Trends

Several trends are emerging within the area of software development. Here are some of the most important trends S. Somasegar has been thinking about recently.

Quick Read

Understanding Parallel Performance

Understanding parallel performance. How do you know when good is good enough?

Quick Read

Short and Tweet: Experiments on Recommending Content from Information Streams

The authors used 12 algorithms to study the URL recommendation on Twitter as a means of better directing attention in information streams.

Quick Read





Video

Forty finalists will gather in Washington, D.C. from March 11-16 to compete for $630,000 in awards.; DDJ; Intel; science; Dr. Dobb's talks with Commonsware's Mark Murphy about what's involved in developing software for the Android operating system; Android; apple; DDJ; tablet development; The new method uses analytics technology developed by the Mayo and IBM collaboration, Medical Imaging Informatics Innovation Center, and has proven a 95 percent accuracy rate in detecting aneurysm.; Algorithm; DDJ; diagnostics; ibm; imaging; T-Mobile USA is enabling phone calls to Haiti without charges for international long distance through January 31 and retroactive to the earthquake on January 12; DDJ; mobile; wireless; Al Williams gives you a demor of One-Der: The One Instruction CPU; DDJ; At the 2010 International Consumer Electronics Show, the auto industry's first working smartphone application was unveiled; DDJ; mobile; The Bluetooth Special Interest Group (SIG) has announced the adoption of BLUETOOTH low energy wireless technology.; bluetooth; DDJ; wireless; IBM has unveiled its list of five innovations that have the potential to change how people live, work and play in cities around the world over the next five to ten years; DDJ; ibm; TeliaSonera's LTE mobile broadband commercial network in Stockholm is now the fastest and largest in the world.; broadband; DDJ; ericsson; mobile; Google has introduced, google Goggles, a visual search application on Android devices that allows users to search for objects using images rather than words; Android; DDJ; google; mobile; Visual Search Applications; Dr. Dobb's talks with David Intersimone, Vice President of Developer Relations and Chief Evangelist at Embarcadero Technologies, about RAD Studio 2010, SQL optimization and his reflections on the software industry.; database programming; DDJ; sql; Researchers from Intel Labs have created an experimental, 48-core Intel processor or "single-chip cloud computer."; cloud computing; DDJ; Intel; multicore; parallelism; The Large Hadron Collider will produce roughly 15 million gigabytes of data annually, to be accessed by a distributed computing and data storage infrastructure called the LHC Computing Grid.; CERN; DDJ; grid computing; physics; A mobile handheld device designed to let users can point, shoot and listen to printed text.; DDJ; Intel; mobile; Ericsson has become the first vendor to prove end to end interoperability in TD-LTE, another standard of 4G radio technologies designed to increase the capacity and speed of mobile telephone networks.; DDJ; ericsson; mobile; TD-LTE; According to a recent study, 80 percent of US respondents feel there are unspoken rules about mobile technology usage, and approximately 69 percent agreed that violations of these unspoken mobile manners are unacceptable.; DDJ; Intel; mobile; IBM and Canonical will introduce a software package for netbooks and other thin client devices in Africa. This is the first cloud- and premise-based Linux netbook software package offered by IBM and Canonical.; cloud computing; DDJ; ibm; His unprecedented ability to manipulate individual atoms signaled a quantum leap forward in in nanoscience experimentation and heralded in the age of nanotechnology.; DDJ; ibm; nanotechnology; IBM honored for its invention of the Blue Gene family of supercomputers. Adobe founders also recognized.; adobe; DDJ; ibm; Former U.S. President Bill Clinton addressed thousands of online entrepreneurs from around the world gathered for the third APEC Business Advisory Council SME Summit in Hangzhou, China.; DDJ; e-business; With free cooling for several months a year, Sweden is an ideal location for cost-efficient data centers.; data centers; DDJ; PNC Bank introduces a new mobile App for the iPhone and iPod touch that provides Virtual Wallet customers with a high-def view of their money while on the go.; DDJ; iphone; The Swedish LTE site will be part of a commercial network scheduled to go live in 2010, bringing data rates far above what is possible in today's mobile broadband networks.; DDJ; ericsson; mobile broadband; Nanotechnology advancement could lead to smaller, faster, more energy efficient computer chips.; circuit boards; DDJ; nanotech; semiconductor; Dr Dobbs talks with with Claudia Backus, Senior Director of Ecosystem Programs at Motorola, regarding the company's recently released MotoDEV Studio for their Android-powered phones.; Android; DDJ; mobile; motodev; The Extremadura Regional Government of Spain and IBM have launched an electronic prescription system in 680 pharmacies in western Spain.; DDJ; ibm; Ericsson to Acquire Majority of Nortel's North American Wireless Business; DDJ; ericsson; mobile; telecom; Nintendo's Wii Sports Resort is an immersive, expansive active-play game that includes a dozen resort-themed activities.; DDJ; nintendo; video games; OnStar can remotely send a signal to the electronic system in the subscriber's stolen vehicle and the vehicle will not be able to be re-started.; cellular; DDJ; wireless; In celebration of the historic Apollo Moon landing, Google has released Moon in Google Earth.; DDJ; google; Ericsson has been awarded contracts with the three telecom operators in China to provide fixed broadband access.; broadband; DDJ; mobile; tv; wireless; Dr. Dobb's talks with Adobe's Adam Lehman about the upcoming release of ColdFusion specifically optimized for Flash and Adobe AIR platform delivery.; adobe; ColdFusion; DDJ; eclipse; Companies team to develop computing device and chipset architectures that will combine the performance of powerful computers with high-bandwidth mobile broadband communications and ubiquitous Internet connectivity.; broadband; DDJ; Intel; mobile; nokia; Adobe Systems and HTC recently announced that the new HTC Hero will be the first Android phone to ship with support for Adobe Flash Platform technology.; adobe; Android; cell phones; DDJ; flash; mobile; mobility; 3.2 million Euros awarded across eight prize categorie recognizing world-class scientific research and artistic creation.; DDJ; A parody of Paul Simon's "50 Ways to Leave Your Lover," but for software security nerds.; DDJ; sql; Dr. Dobb's Mike Riley talks with Jim Manias of Advanced Systems Concepts.  In this conversation, Jim discusses the new ActiveBatch 7 and how it can provide significant productivity gains for application developers and business process owners alike.; ActiveBatch; DDJ; Sun cofounder Scott McNealy and Oracle CEO Larry Ellison discussed Java's role in computing. Sun has also released OpenSolaris 2009.06.; DDJ; java; opensolaris; oracle; sun; Spotlight on NATO's centre of excellence on cyber defense in Tallinn, Estonia.; cyber defense; DDJ; nework security; security; Create Data Access Layers in ASP.NET; DDJ; In this demonstration you will learn how to layout a WPF application. We will explore the major layout panels that come with WPF, contrasting them with each other and describing when to use each.; DDJ; web development; windows; wpf; The Intel Foundation has announced the top winners of the Intel International Science and Engineering Fair; DDJ; Intel; News; science; Matt Hester demonstrates Internet Explorer’s 8 new feature Selectors API for utilizing CSS selectors for quick and easy element lookups.; DDJ; IE8; microsoft; windows; The NATO Virtual Silk Highway provides affordable, high-speed Internet access via satellite to the academic communities of the Caucasus and Central Asia.; DDJ; On a Windows Mobile device, applications are typically not closed down, but they stay in the background. Maarten Struys shows you a simple way to preserve battery power inside your own applications.; DDJ; microsoft; power consumption; windows; Windows Mobile Devices; Cadillac is now offering wireless Internet access with its CTS sedan.; DDJ; wireless broadband; By default, Windows Mobile Standard (Smartphone) applications launched from Visual Studio are not accessible on the device/emulator once they are minimized. In this video, Jim Wilson demonstrates two simple techniques to solve the problem.; DDJ; microsoft; smartphone; VIsual Studio; Mike Riley talks with the brass from Everypoint, creators of the NEMO mobile application development platform.; DDJ; Developers; development environments; mobile applications; Symmetric and asymmetric encryption algorithms, the SHA256 hash encryption algorithms, and how to implement in a simple application using Microsoft's Azure Services Platform.; Azure; DDJ; encryption; microsoft; security; windows; T-Mobile has introduced the Sidekick LX, which features enhanced video capability.; DDJ; Mobile Smartphone; Bluetooth 3.0 offers speedier transmission of large amounts of video, music and photos between devices wirelessly.; bluetooth; DDJ; mobile networks; wireless broadband; Cities around the world are battling with stressed transportation networks, so IBM has announced plans for three new smart rail projects in China, Taiwan and The Netherlands.; DDJ; ibm; ILOG; CASMOBOT is a Nintendo Wii remote controlled slope lawn mower.; DDJ; Denmark; nintendo wii; research; robotics; Project ensures documents, images, video and other Internet-based data growing at over 100 terabytes per month will live on for future generations; data storage; DDJ; history; Intenet; research; Sun Microsystems; Dr. Dobb's talks with Dave McAllister, Director of Standards and Open Source for Adobe, about the Open Screen Project.; adobe; DDJ; Open Screen Project; open source; The Facebook Connect SDK provides the code to let third-party developers embed hooks into their applications so users can connect to their Facebook accounts and exchange information using iPhone apps.; apple; cocoa; DDJ; Facebook; iphone; Mars in Google Earth Updated; DDJ; google; google earth; Google mars; red planet; The Sun Cloud is built on the Sun Open Cloud Platform that leverages the best in world-class open source technologies. The Sun Open Cloud Platform brings together Java, MySQL, OpenSolaris and OpenStorage.; cloud computing; DDJ; java; open solaris; sun; DDJ; High School; Intel; science; ILOG Elixir is a suite of professional user interface controls that gives developers a rich collection of innovative and interactive data display components for Adobe Flex and Adobe Air.; adobe; air; DDJ; elixir; flash; flex; ILOG; The inaugural San Diego Science Festival being held this month is touted as one of the largest multicultural, multigenerational, multidisciplinary celebrations of science ever seen on the West Coast; DDJ; lockheed; News; science; IBM has announced Innov8 version 2, a new version of its serious game that helps students and professionals hone their business and technology skills in a compelling, familiar video game format.; DDJ; ibm; serious games; Swiss Automobile Visionary Frank M. Rinderknecht builds a concept car with adaptive energy concept and iPhone controls.; apple; Concept Car; DDJ; iphone; j; siemens; Two-Year Plan to Focus on 32 Nanometer Manufacturing Technology; 32 nanometer technology; chip; cpu; DDJ; gpu; Intel; manufacturing; Nehalem; Westmere; New version features ocean layer, historical imagery, and more.; DDJ; google; Dr. Dobb's talks with Marty Alchin, author of "Pro Django" about his book and the deep internals of the Django framework.; DDJ; Django; A new content-authoring solution for learning professionals; adobe; DDJ; toolkits; web authoring; In a Second Life setting, Danny Coward discusses Java FX with Dr. Dobb's Jon Erickson.; DDJ; java; JavaFX; sun; The Core i7 processor is the first member of a new family of Nehalem processor designs with new technologies that boost performance on demand.; chip; DDJ; Intel; processors; Dan Diephouse, creator of XFire, a high-performance open-source SOAP framework (which became the Apache CXF project), shares the five common mistakes in SOA governance and insight about the Apache CXF and Mule RESTpack development environments.; apache; Apache CXF; DDJ; mule; open source; soa; soap; Xfire; Adrian Kaehler and Gary Bradski discuss the Open Computer Vision Library (sourceforge.net/projects/opencvlibrary/) and their book "Learning OpenCV".; DDJ; Open Computer Vision Library; OpenCV; In the first part of this two-part interview, Stephen Wolfram reflects on the 20-year anniversary of Wolfram Research.; DDJ; Mathematica; Mathematics; science; In the second part of this two-part interview, Stephen Wolfram discusses his book "A New Kind of Science."; DDJ; Mathematica; Mathematics; science; Nick Hodges talks about Delphi 2009, a RAD tool for Windows, and Delphi Prism, a database engine for Windows, Mac OS X, and Linux.; DDJ; delphi; RAD; windows; Dr. Dobb's talks with Tony Lombardo, lead Technical Evangelist at Infragistics, about all new UI tools for Windows and .NET.; .net; DDJ; silverlight; ui; windows; wpf; Dr. Dobb's talks with Eric Schulz about his International Mathematica User's Conference 2008 presentation on the Mathematica Essentials Palette and the future digital educational material; DDJ; Mathematica; Mathematics; Dr. Dobb's talks with ActiveState's Trent Mick about the recently released Komodo IDE 5.0.; DDJ; ide; open source; Dr. Dobb's talks with Continuity Logic's Kris Carlson about "Why We Die: Simulation of the Evolution of Senescence" and why he programs with Mathematica's functional programming language.; DDJ; functional programming; Mathematica; simulation; Ericsson collaborates with Intel; DDJ; ericsson; Intel; Mobile technology; Dr. Dobb's talks with Schoeller Porter about the grid and cloud versions of Mathematica; clouds; DDJ; Grid; Mathematica; Dr Dobb's interviews Yehuda Katz, maintainer of the Merb project, about the advantages this highly optimized Ruby on Rails alternative offers to web application developers.; DDJ; Ruby on Rails; Dr. Dobb's talks with Thomas Roman, Professor of Mathematics at Central Connecticut State University, about "Mathematica Visualization in a Theoretical Physics Problem - Negative Energy in an Unusual Quantum State."; DDJ; Mathematica; physics; quantum; science; The Forbidden City: Beyond Space & Time is a fully immersive, three-dimensional virtual world that recreates a visceral sense of space and time.; Blade Server; China; DDJ; ibm; linux; mac; online; virtual world; windows; Dr. Dobb's interviews open source luminary Miguel de Icaza about his latest milestone of achieving Microsoft .NET 2.0 Framework compatibility with the Mono Project .; DDJ; Dr. Dobb/s interviews Paul Kimmel, author of "LINQ Unleashed for C#", about Microsoft's new query technology that lets developers poll any information from any data source regardless of location or structure. I; C#; DDJ; Dr. Dobb's; LINQ; microsoft; It takes a supercomputer to build a super car. ; DDJ; HPC; simulation; Dr. Dobb's shows how to install and execute cross-platform scripting languages on the Windows Mobile platform. In this installment, Mike Riley examines Perl for Windows Mobile devices.; DDJ; mobile devices; perl; windows; Dr. Dobb's shows how to install and execute cross-platform scripting languages on the Windows Mobile platform. In this installment, Mike Riley examines Python CE which is optimized for Windows Mobile devices.; DDJ; mobile devices; python; windows; Dr. Dobb's shows how to install and execute cross-platform scripting languages on the Windows Mobile platform. In this installment, Mike Riley examines Ruby for Windows Mobile devices.; DDJ; mobile devices; ruby; windows; Young participants at ITU TELECOM ASIA 2008 in Bangkok, Thailand received free laptops as part of ITU’s initiative to promote affordable devices to increase access to information and communication technologies.; communication; DDJ; itu; Currently technical strategist to Microsoft's Chief Software Architect, Rebecca Norlander has had a tremendous impact on Excel, Internet Explorer, Windows XP SP2, and Windows Vista Security. ; DDJ; microsoft; Contributing authors to the book "Beautiful Code" got together at Dr. Dobb's SD West Conference in March, 2008. Part 1 of 3.; DDJ; programming; software development; Contributing authors to the book "Beautiful Code" got together at Dr. Dobb's SD West Conference in March, 2008. Part 2 of 3.; DDJ; programming; software development; Contributing authors to the book "Beautiful Code" got together at Dr. Dobb's SD West Conference in March, 2008. Part 3 of 3.; DDJ; programming; software development; Anders Hejlsberg discusses C#, Turbo Pascal, and what it means to design a programming language. ; C#; DDJ; microsoft; Turbo Pascal; Solar powered laptops given to youths at ITU Asia 2008.; DDJ; News; telecommunications; IBM breakthrough stands to impact future direction of information technology.; DDJ; Mike Riley spoke to ActiveState's Jeff Hobbes about the new features in Tcl Dev Kit and Perl Dev Kit including the code coverage and hot-spot analysis tool and Mac OSX support.; DDJ; Tim O'Reilly addressed the OSCON convention in his Wednesday keynote titled "Degrees of Freedom, Open Source in the Wed 2.0 Era.; DDJ;