New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Jonathan Allen on Oct 27, 2008
Before we dig into the first C# feature, let it be known that Microsoft has promised that any capability found in C# will be offered in VB and vice versa in some fashion. However, they will not necessarily offer it the same way and the languages are expected to continue to diverge.
With the increasing importance of dynamic languages and the DLR, C# needs to be able to work with dynamically typed objects. Currently it is possible to make late bound calls via reflection for static classes, but this takes a lot of code. Moreover, calls to DLR objects require an entirely different call using the DLR's reflection libraries.
In C#, you simply declare the object's static type as "dynamic". Like VB's Option Explicit Off, this tells the compiler to emit the necessary code to resolve the method binding at runtime calls. At the IL, variables declared as dynamic are really of type System.Object with an additional tag indicating it uses dynamic calling semantics.
At runtime all of the normal overload resolution rules work against the object's runtime type. This means you get the ability to perform multiple dispatch directly instead of jumping through reflection or using visitor patterns.
Each dynamic language has its own rules for member lookup. To support this object can implement the IDynamicObject interface. If it exists on the runtime object, the object gets to handle its own member lookup. In the demonstration, Anders showed how to define a dynamic object in C# itself.
And of course, all this means you can use duck typing wherever you want in C#.
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Fair Trade Software Licensing - A Guide to Neo4j Licensing Options
It would be nice to show an example of what this would look like to the developer.
Sorry about that. Here is an example:
dynamic obj = [some function];
obj.Foo();
As you can see, there really isn't much to it.
It would be nicer to do:
var obj = [some function];
obj.Foo();
I am quite curious about this quote: "At runtime all of the normal overload resolution rules work against the object's runtime type. This means you get the ability to perform multiple dispatch directly..."
Does this mean that the dispatching is done on all runtime types for the method parameters, ala CLOS? And how is this specific to dynamic type?
Thank you for the time and help
Kind regards
Srdjan
The thing is, var is just a place holder while dynamic is a type. This means you can write:
string GetText(dynamic foo){
return foo.Text;
}
Lets say you have this code:
void Foo(dynamic a, dynamic b, dynamic c) {
a.Bar(b, c)
}
What happens is the runtime asks object a "What should happen when I call 'Bar' with types b.GetType and c.GetType?". If a is a python object the answer may very well be different than is a is a C# object.
Since the decision is being made entirely at runtime, I would expect you see to see CLOS-like dispatching.
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
6 comments
Watch Thread Reply