Santosh Benjamin's Weblog

Adventures with AppFabric, BizTalk & Clouds

Archive for the ‘General’ Category

Presenting AppFabric @Avanade Soltech AfterHours

with one comment


I have been invited to present a session on Exploring AppFabric (Server & Cloud) at Avanade, London on the 28th October (next week). This is part of the regular Soltech After Hours meetings. This session will be a hands on look into the components of both Server AppFabric as well as Azure AppFabric. We will also look at how these offerings fit into Microsoft’s overall platform strategy and how they align with other products such as BizTalk Server and what the roadmap for all of them looks like.

My AppFabric presentation at TechDays Online 2010  went off very well. Thanks to all those who took the time out to attend my session as well as the other sessions. There were more than a 350 attendees through the day and even with 3 tracks going on simultaneously, I managed to get over a 100 in my talk alone which is really encouraging  🙂 . If you attended my webcast (or have watched it since) and have any questions or require clarifications, feel free to ping me on this blog.

Written by santoshbenjamin

October 21, 2010 at 6:25 PM

Posted in AppFabric, Conferences

Tagged with , ,

Presenting Azure AppFabric @ TechDays 2010

leave a comment »


In case you weren’t aware, we are organizing the TechDays Online Conference on Oct8th. Check out the agenda. You’ll find some well known names and an unknown one in the middle 🙂 Yep, lil ol’ me speaking on a “Lap Around Azure AppFabric” at 1pm in Track-1.

In general the track is supposed to be a high level one but i will be talking about getting to grips with the AppFabric vision, components that are on-premises, in the cloud and the general plan for convergence. We’ll also talk about how good ol BizTalk Server fits into this vision. We’ll discuss common patterns of usage in the Service Bus and ACS.

If you can make it, do register for the conference and it would be cool to have you attend my talk !!

Written by santoshbenjamin

September 22, 2010 at 6:10 PM

Posted in Conferences

Tagged with ,

A nice metaphor for object orientation and service orientation

with one comment


I was recently watching an awesome webcast by Scott Hanselman on the topic of OData. Even if you are familiar with OData, I would recommend that webcast. The way he explains the position of REST and WS* is very balanced and educative. No dogmatic rants on how “rubbish” WS* is and how waay-cool (not) REST is. Anyway, more about the subject of that webcast in another post but what I wanted to highlight was this cool metaphor that Scott used when talking about OO and SO.

To paraphrase his illustration, “In the old days in the 90s we would model, say, a book as a “Book” object and that book object would have a “Checkout()” method and we would call “book.Checkout()” and we would sit back feeling satisfied with the “real world” approach. But then service orientation made us realize that there really is a Librarian Service and a Checkout Request and you submit the Checkout Request to the Librarian Service and it would go off and do that work asynchronously and you would “hang out” in the library and when it was ready it would call you back and give you the Book Checkout Response. This turns out to be a better metaphor for how life works. 

 IMO, this is a great explanation for the difference in approaches to system design. It’s still quite possible for these two to co-exist in scenarios where we design the “macro” system with SO and the internal components follow nice “OO” composition and/or hierarchies. The really cool part of SO is that it takes the “encapsulation” level much higher up. Consumers think in more coarse grained terms of message exchange patterns and about service levels rather than about methods on individual objects.

Written by santoshbenjamin

September 5, 2010 at 3:39 PM

Posted in Coding, General, System Design

Tagged with ,

A new lifetime gig

with one comment


I’m Dad again for the second time 🙂 . Baby Rachel arrived last week and is already alert and ready to take over the world. Just check out the picture.

Rachel Benjamin

Well, I guess that pretty much squeezes down my community project bandwidth down to a minimum. This is going to be a long project. Western parents usually get away with an 18-year gig but Indian ones don’t 🙂

Written by santoshbenjamin

September 1, 2010 at 10:37 PM

Posted in General

Tagged with

MockingBird Videos

with 4 comments


I’ve taken my first foray into the world of producing videos with a set for MockingBird.

Take a look and let me know what you think of the quality and content (and also if these links all work for you. SkyDrive has been giving me some problems in sending links around). I will work on doing more videos if there is a demand for them.  Looking forward to your feedback.

Written by santoshbenjamin

August 15, 2010 at 4:41 PM

Posted in MockingBird, Tools, Videos

Tagged with ,

LINQ-ed Lists

leave a comment »


If you’re still staying on the fringes of LINQ (quite like me 🙂 ) , here’s something I found that got me liking it quite a bit more and maybe it will do the same for you. I like LINQ in small doses. I’ve seen horrible complex expressions that I would never understand even if i lived a million years, and I dont want to write such code, so I only use it where it makes expressing intent concise and preferably, in one simple line.   (Read on only if you are not a LINQ expert).

So I’ve got a (contrived) example here that resembles closely a few problems I needed to solve recently. The 3 or 4 main scenarios I was faced with are as follows  (all operating on a list of complex objects).

  • Remove a set of entries (specific criteria) from somewhere in the list
  • Check if the list contains all the specified objects
  • Finding an object with a specific attribute (pretty much a subset of any of the 3 scenarios above).

Now as you can imagine,  removing entries from custom collections is not a trivial task. Iterating through collections and deleting them causes collection modification errors as the system tries to deal with the changing length of the collection and so on. Even finding an item in a custom collection is several lines of a foreach. So here’s how to do all this in a trivial way in LINQ.  (Its possible there are even more concise ways to do this , so feel free to enlighten me (as long as it doesnt involve an IQueryable<> that joins to an IEnumerable<> and magically projects something into the universe, blah, blah etc 🙂 , see I know the lingo!)

Assume a class named Customer (what else ?) with the following structure

class Customer
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public Customer(int id, string name)
        {
            this.Id = id;
            this.Name = name;
        }
    }

Now lets assume I create a List<> of these customer objects named Customers with values such as (1,Name1), (2,Name2), (3,Name3) and so on.

Remove all customers with name = Name2

customers.RemoveAll(c => c.Name.Equals(“Name2”));

Check if the list contains all the given entries

List<string> expectedReferences = new List<string> { “Name1”, “Name2”, “Name3”, “Name4”, “Name5” };

var references = from c in customers select c.Name;

Console.WriteLine(expectedReferences.SequenceEqual(references));

Finding an entry with a specific criteria

var result = from c in customers where c.Name.Equals(“Name2”) select c;

.. and so on. If your custom object implements the Equals property then you can do even more funky stuff like returning the Intersection (common elements) of the lists or the Except (distinct elements) with single lines of code. I thought the RemoveAll() and SequenceEqual() methods were particularly fascinating because of the amount of code they reduce. I immediately put this to work in the project and in MockingBird where I had a number of places where I was doing object searches.

So that’s it on the subject of LINQ for now. Definitely not intended to be a tutorial. Just something I found and it helped me quite a bit.

Written by santoshbenjamin

August 3, 2010 at 10:31 PM

Posted in Coding, General, LINQ

Tagged with

Speaking on AppFabric @ SBUG

leave a comment »


I’m delighted to be delivering my first presentation for the UK SOA/BPM User Group next week on the topic of Windows Server AppFabric (formerly code-named “Dublin”). The link to register is here and the page will be updated with the abstract shortly.

The tight integration between WCF and WF 4.0  and the hosting support in AppFabric is looking very promising now and will definitely provide a good platform for solutions which dont require BizTalk and, where BizTalk is already available, can work well alongside and integrate with it.   We’ll look at some scenarios where there may be overlap and how to approach the solution in such cases. Sure there will be some good discussions !

I know Yossi will be there 🙂 . Looking forward to catching up with some of the other UK / London gang as well.

Written by santoshbenjamin

January 18, 2010 at 9:38 AM

Using INTERSECT with LINQ to XML

leave a comment »


In terms of hands-on coding (not general awareness) I’m a bit of a newbie to the world of LINQ actually, having only dabbled with a little LINQ to XML in MockingBird and even there I wasnt too impressed with it in the area of XPath queries. But I came across something yesterday that is a testimony to the power of LINQ.

My scenario was that I wanted to compare two XML documents that followed the same schema, but I wanted to do this in  a fairly generic way without writing code to explicitly pick up every element in the hierarchy. My requirement was to find all common elements between the two documents and also the elements in one and not the other.

Take the following example:

Document-1
<Authors>
  <Author ID=”1″ Name=”AuthorA” JoinDate=”3/1/2009″/>
  <Author ID=”2″ Name=”AuthorC” JoinDate=”3/1/2009″/>
</Authors>
Document-2
<Authors>
  <Author ID=”1″ Name=”AuthorA” JoinDate=”3/1/2009″/>
  <Author ID=”2″ Name=”AuthorB” JoinDate=”3/1/2009″/>
</Authors>

I quickly found that LINQ has this powerful INTERSECT function which would allow me to find the common elements and the EXCEPT function which will find the distinct elements.

My first attempt (at finding the common elements) was like this:

var commonFromA = aDoc.Descendants(“Authors”).Intersect(bDoc.Descendants(“Authors”));

But this did not work. After much more attempts and discussions with colleagues, it was beginning to look like i could only use INTERSECT with native types and I would either have to write a custom IEqualityComparer<T> or write more complex code involving anonymous types (which are , by the way, a brilliant feature of the framework).

But LINQ is supposed to be elegant, right? So I posted the question on the MSDN Forums and got an immediate reply from Martin Honnen   a MVP in this area, and yes, the solution was elegant and just in one line.

var commonFromA = aDoc.Descendants(“Author”).Cast<XNode>().Intersect(bDoc.Descendants(“Author”).Cast<XNode>(), new XNodeEqualityComparer());

As Martin explained, the set operators like INTERSECT and EXCEPT work on object identity not value comparisons and as I had distinct XElement objects in different documents my initial attempt would not work. However, the XNodeEqualityComparer comes to the rescue and casting the XElement to XNode was all that was required.

What’s even more interesting is that in .NET 4.0, we have something called “contravariance” which will allow the INTERSECT code above to work without the explicit cast. Martin explains this very well in this post on “Exploiting Contravariance with LINQ to XML”. I always wanted to understand what Covariance and Contravariance were all about and this is a great explanation.

Essentially, with Contravariance, you can pass in the base type XElement even though the comparison (with XNodeComparer) is expecting an XNode , (the derived type) and you dont need to mess with casting etc. With Contravariance you are also not mutating the object itself (actually, you cannot change the object) so this works.

On the same subject, also check out Eric Lipperts blog article.  I had come across that post earlier but didnt have any immediate need for that functionality so I didnt pay attention, but this time, I did.

So, there you have it. A one line solution for comparing XML documents. (The “EXCEPT” code was also one line). Of course if you want to find out specific attribute values and changes, then the code becomes more involved, but you’ve gotta admit that this is elegant. Can you imagine how much code this would need in the Xml DOM world!!

I’m starting to get hooked on LINQ!  🙂

Written by santoshbenjamin

November 28, 2009 at 6:21 PM

My first year at MCS

with 2 comments


Last Tuesday (the 18th Aug) marked my first year at Microsoft Consulting Services (UK). I can’t believe how fast time has gone by. Years ago, I used to wonder how it would be to work in MCS and dismissed the idea as too high to aspire to and yet here I am after a full year at the very same place. So what’s life been like working for Microsoft? Here’s what I’ve seen. [Remember, this is just the view through my lenses , nothing indicates company policies etc 🙂 ]

My first 3 months were rather quiet, as they are considered a “ramp-up” period and usually one is expected to network and round-off your skills. However, I was warned that the 3 months would fly and then it would be liked drinking from a fire-hose, and the warning was absolutely spot on. It’s been a rollercoaster from last November.

The first thing that struck me (not surprisingly though) was the calibre quotient of my colleagues. While I have, in the past, worked with some top notch developers and architects, it just seems that the “average” knowledge is a mile higher than at other places. For instance, I could think I know all about SQL and then find myself sitting next to a chap who did a stint on the SQL product group and knows more about the core engine than anyone else in the world (now, this part is anecdotal, i didn’t actually encounter that myself, but heard of someone who did, but you get the picture  🙂 . Darren Jefford is the architect on my current gig. A couple of years ago, when just reading through Darren’s blog I couldn’t have imagined working on the same team as Darren. C’est la vie!  (I couldn’t resist that bit of name dropping).

The second thing that took me by surprise was the how committed Microsoft is to partners both at the platform / product level as well as in Services. With our products, we pride ourselves on building the best platform and tool support possible and empowering partners and vendors to build on top of that. Sure, MS has a record of being somewhat ‘predatorial’ in the past, but it looks and feels different in that respect now.  In the Services side, it’s common to find a number of partner companies working alongside us to deliver the projects and there too, it’s common to find that many of the developers and architects from partners  are leading bloggers. MVPs and generally, well known in their respective dev communities. [Ok, one more name-drop.. did you know i’m actually working with the legendary BizTalk “Arch Hacker” ? It’s true he wears the mask of Zorro to work !! …(ha ha just kidding….)]

Then there’s the veritable flood of information and access to stuff ages before it becomes public!  Of course, while a lot of that is non-disclosable to external audiences, within the company, information does flow quite freely (which I heard, from someone who joined us from a competitor, is not always the case in large software houses). Unfortunately, there’s seldom the time to actually use all that 😦 and in this respect, you’re on your own. There is a lot of structured learning on offer, but balancing that with project commitments is a fine art.

Ok, so that’s all about the company. So, what’s the personal impact been?

Firstly, its the amount I’ve learned technically (which is, of course, to be expected in a place like this). My knowledge of BizTalk, especially, has been deepened considerably both by the requirements of the current gig (which is in its 6th month now) as well as just absorbing tons of stuff from my colleagues.

Secondly, it’s been great to see, first-hand, very large scale projects delivered successfully and on time. I have been involved in some quite big (and successful) projects through the years, but the sheer scale of the projects here is far beyond what I’ve worked with in the past). [On the technical side of this, its been eye opening to see how useful TFS is for project tracking and reporting].

Thirdly, it’s also made me raise the bar for my own community contributions. I take longer to make something public than I would have done in the past.  Although my community contributions are personal and not Microsoft IP,there is the implicit association with MS and i find myself thinking “is this good enough to be associated with an MCS guy!” . Take MockingBird, for instance. This ‘implicit’ association ensured it was better at first release than it would have been, say, 2 years ago. There’s both the knowledge gained over the years as well as the “this has to be good enough to be published by a Microsoft chap” that helped it. Not that I’ve reached some sort of ‘coding guru’ status (or ever will), and  there’s always more to be learnt and improvements to be made in all areas but I’m definitely more satisfied with the quality of my output now.

So, it’s been a good year. I’m looking forward to the rest of year-2. One year at a time!

Written by santoshbenjamin

August 22, 2009 at 1:08 PM

Posted in General

Tagged with , ,

VS Color Schemes : Rejuvenating Development

leave a comment »


Ok, so I’ve been really late to this particular party, but I gotta say, I’m absolutely thrilled with the effect that changing the color schemes of VS has on improving my coding morale!! I’ve been using several schemes from Tomas Restrepo’s collection and its done wonders for me  (specifically Ragnorak Blue, Grey and Moria Alternate).  Since I’m using VS 2005 and 2008 side by side, I have quite different color schemes for them and it makes things more interesting than the mundane white background. Maybe it’s also age and the fact that my eyes get tired more easily but hey, Consolas at 15pt looks awesome. 🙂

Having said this, I also started work on Dev10 and I must say, the OOB color scheme is nice. The new WPF editor renders the fonts much crisper and neater so I’ve been content to leave it without changing to a dark background. I guess we’ll have to wait a while for some new schemes to emerge. Quite sure the new editor has various new options for color schemes.

Another thing that its done, aside from make my IDE look nicer, is that it’s given me a coding boost. In fact, my releasing BizUnitExtensions 3.0 is more down to the new color scheme than anything else 🙂 .

So, if you havent taken this particular plunge yet, why not try it out?

Written by santoshbenjamin

June 1, 2009 at 2:14 PM

Posted in Coding, General