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 Aug 13, 2008
Currently .NET languages such as VB and C# do not support covariance and contravariance for generics. This is not likely to chance in the near future, though people at Microsoft are talking about it. A full introduction to covariance and contravariance would take too long. For that we ask reader's turn to Eric Lippert's series on Covariance and Contravariance in C#.
In order to add support for covariant and contravariant generic types in VB, Lucian Wischik has proposed the following syntax.
Type parameters can be decorated with the keywords "In" and "Out. An "In" type is a type that can only appear as a method parameter. Likewise, an "Out" type is one that would only appear as the return type of a method.
An example of where Out types would be useful is IEnumerable(Of T). If a function is expecting an IEnumerable(Of Animal), giving it an IEnumerable(of Bird) should work under all circumstances. For In types, a somewhat contrived example is in order. Consider this interface:
Interface IWriter(Of T)
Write(value As T)
If you pass an IWriter(Of Bird) to a function expecting an IWriter(Of Animal), clearly it would not work. The method could pass any subclass of Animal to IWriter.Write, though only Birds are supported.
With the annotations, the interfaces would look like:
Interface IEnumerable(Of Out T)
Interface IWriter(Of In T)
While this was proposed for VB, it could also be used in C#.
interface IEnumerable<out T>
interface IWriter<in T>
Unfortunately this syntax doesn't directly work in the most common scenarios. Consider IList(Of T). When passing to methods that write to the collection, T should be an In type. But when passing to methods that read from the collection, it should be an Out type. Perhaps the solution here is to retroactively create base classes for IList that separate the methods that accept a T value from the ones that return one.
On a historical note, C# and VB both support array covariance (out/IEnumerable scenario) even though it can lead to runtime errors in contravariant situations (in/IWriter scenario). This was done in order to make C# more compatible with Java. This is generally considered a poor decision, but it cannot be undone at this time.
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Agile Maturity Model Applied to Building and Releasing Software
Agile Development: A Manager's Roadmap for Success
Case Study: IBM's Agile Transformation
Agile Practices to Improve Project Management Organization (PMO) Effectiveness
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.
No comments
Watch Thread Reply