Cisco announced a new core router, named CSR-3, delivering 322 Tbit/s:
http://www.lightreading.com/document.asp?doc_id=188914&
My brother-in-law is part of this project. I'm not sure whether his part is the extra 22 Tera bits beyond 300, but he is there inside for the past years and has a major role there.
Whether this is a world shocking event for the internet world or not we will see, but for sure this is a landmark, comparing to the 56K b/sec not long ago (well, this is not an honest comparison, comparing home pace to core, but still the rate at the core level got from gigs to teras - factor of 1,000).
It's a very happy declaration for companies doing video services, IPTV etc. Of course there is still the need to propagate these paces to the homes, with fiber to the home, but this is already happening at some countries and will expand (Hong Kong, Hague, more Europe, and it happens that Kansas city even changed its name to get fiber).
With 322 Tbits/s it sounds that someone needs to really start working on teleporting.
Wednesday, March 10, 2010
Cisco new router deliverring 322 Tbit/s
Tuesday, February 16, 2010
Multiple Inheritance - should you?
It is often argued that multiple inheritance in C++ is not a good practice. This is why Java doesn't have this ability. Of course, multiple inheritance in C++ for something that is similar to interface implementation as in Java is reasonable, this is the case when all classes inherited from are pure abstract with no data members and no implementaions, only pure virtual methods, except one base which is the true parent.
However, in some cases you do see in C++ multiple inheritance that is not just interface implementation. And in some cases it seems reasonable. The iostream library is using it quite a lot.
I had a code review in which the developer used multiple inheritance. He said he was considering whether to use it or not and decided it serves his goal. Indeed it was OK, there was a class "SomeSortOfEventHandler" that was of both types "A_CertainEventHandler" and "AnotherKindOfEventHandler", that is, the "SomeSortOfEventHandler" was in fact handler for two kinds of events. In this case there was no need for virtual inheritance from the top parent ("AbstractEventHandler"), as the special "SomeSortOfEventHandler" need to have the data and behavior of both its parents.
So far so good. But at a certain point there was a need to implement a virtual method in two flavors, one for being the child of one parent and the other for being the child of the other. This becomes nasty. One can add to the virtual method a parameter of type T (there is a template class at the top, that differentiate the different families under "AbstractEventHandler") - but this is not so elegant as there is no real need for this parameter. All other alternatives were also breaking the elegancy of the inheritance tree. Conclusion: better to create two separate classes and hold a pointer from one to the other to get the relation between two objects, rather than use multiple inheritance.
Sunday, November 22, 2009
Array of Generic Type
I was asked why one cannot create an array of generic type, which means this line cannot compile:
// the below doesn't compile
ArrayList<Integer>[] arrayOfLists = new ArrayList<Integer>[7];
The compiler doesn't like the creation part, on the right, while the declaration alone, on the left, goes fine. This issue is widly discussed, e.g. nicely described here.
There are many ideas why it is forbidden and many suggestions for workarounds. But the nice colleague who asked me this question liked the most the workaround I suggested him, which is very simple.
I started by asking why he needs this.
And he explained that he needs to manage some info for 7 days a week:
// the below doesn't compile
ArrayList<SomeInfo>[] weeklyInfo = new ArrayList<SomeInfo>[7];
I suggested to create two new classes, DailyInfo and WeeklyInfo:
class DailyInfo {
private ArrayList<SomeInfo> dailyInfo = new ArrayList<SomeInfo>();
...
}
class WeeklyInfo {
private DailyInfo[] dailyInfo = new DailyInfo[7];
...
}
In most cases this would be the right object oriented approach, which by the way solves the problem of array of generic type.