Andres Aguiar's Weblog

Just My Code

October 2008 - Posts

Don Box and Data

6 years ago I was in a WebServices DevCon in Boston and Don Box did a presentation about data, where he started playing with SQL and doing things like 'insert into people select * from products'. As People/Products had the same schema (Id/Name), it worked fine (I'm not sure if that was the actual example, but it was something like that). The object-oriented-strongly-typed heads in the audience were nodding saying that he was doing something 'bad'.

I also remember a blog post from Don from some time ago (that I couldn't find) saying that XML schemas were relative to the consumer. One XML document can comply with a lot of XML schemas. What was important was not that it had a specific structure, but that it had a structure that was compatible with what you needed. I could have an XSD that says that I need 'Id' and 'Name' and I don't care about the rest, and if an XML document had it, then it was good enough for me.

I remembered this when he was describing the typing in M. Basically, in M if two types have the same properties, they are equivalent. Just as in SQL. And in XSD. And in duck typing.

Describing Intentions

Everyone in Microsoft is talking about writing declaratively and letting the user express the intention and not the steps required to perform the task.

I've heard it at least 3 times:

- In the Olso talks

- In the 'XAML as a declarative language' talk

- In the F# talk

Now, even if it's true that in every case the proposed way was more declarative than the alternative, it's obviously not the same thing to 'declare' something in a DSL, XAML, or F#. Abusing the term will make it just another buzzword (or perhaps it already is), so I think we need to be careful with it.

Posted: Oct 31 2008, 06:24 AM by aaguiar | with no comments
Filed under: , ,
Models and Oslo

Oslo was the most interesting technology I've seen at the PDC by far, and the Quadrant session was really amazing. If you did not see it yet, go and watch it. They had Quadrant run in the Microsoft Surface in the Expo area, and being able to explore a model using Surface is very powerful.

However, I think several Oslo demo were confusing, in the sense that they used the textual DSLs to define things like 'Music' and create a SQL model for it.

With examples like that, it could look that 'M' is designed to let you define a domain model for your LOB application. And that's not the case. You will use the Entity Data Model for that, and there will be an M-Grammar for defining the EDM, or at least that's what Tim Mallalieu suggested in his presentation about the future of the Entity Framework.

The M->SQL mapping will be useful when you have an application that needs metadata to run. If you have a 'Products' entity in your application domain model, you'll probably have a 'Products' table in your application's DB schema and a set of records in your 'Oslo' DB Schema that describe the entity.

Posted: Oct 31 2008, 06:24 AM by aaguiar | with no comments
Filed under: , ,
Oslo

I was going to write a large post on Oslo, until I found this one. I still did not play enough with it yet to add value to what Fowler said.

As I guess everyone in the world is waiting to listen what I have to say about it, I'd just say that I liked it, and that it's probably the most exciting piece of technology I've seen during the PDC.

I still have a lot of questions that I'll try to answer by reading the book, playing with the bits, and trying to grab some Oslo guy during the breaks.

Posted: Oct 29 2008, 05:31 AM by aaguiar | with 2 comment(s)
Filed under: , ,
PDC Day 2 - A much better Keynote

The first genuine, spontaneous, unanimous round of applause after a Keynote demo happened today when they shown the Live Mesh stuff. Two 'friends' were looking at the same picture, one edited it, and it was immediately changed in the other one's machine.

Today's keynote was good. The highlights were Windows 7, Mesh, and Office 14.

Office 14 has a web counterpart written in Silverlight, that edits with full fidelity Word, Excel, Powerpoint and OneNote documents. Google Apps and the rest of the online 'Office' tools will have a hard time competing with this.

Office 14 also has cool collaboration (two people can edit the same document and they get notified of the changes made by the other one), and web-publishing features (you can publish a chart in a webpage that has a live link to a Excel 'online' spreadsheet), but those things can be done with Google Apps too.

The 'Lap Around Azure' demo by Don Box and Chris Anderson was fun but they only feature that was not shown before was the Service Bus. The rest of the stuff ships with .NET 3.5SP1 or it was demoed in the previous day. I was expecting more Oslo content in the Keynote, but it looks that it's still to fuzzy for a Keynote.

Infragistics goes to Hollywood

Infragistics sponsored the Expo-Hall Reception yesterday night, and all the Infragistics guys went dressed as movie characters or movie stars.

I made 'Jay and Silent Bob' with Ambrose (some people could not believe he was actually an Infragistics employee and not a Kevin Smith double). Other characters included Indiana Jones, Sherlock Holmes, Darth Vader, Obi Wan Kenobi, Princess Leia, Cruella de Vil, Tom Cruise, Karate Kid, Jack Sparrow, the Joke, Batman, several Marilyn Monroes and I probably forgetting someone.

A lot of people, including myself, took pictures, but I won't be the one publishing one where I wear my blonde wig. I disabled tagging in Facebook just in case ;).

It was quite fun.

PC27: Microsoft Silverlight, WPF and the Microsoft .NET Framework: Sharing Skills and Code

I attended this session as I'm working in both platforms right now, and expected to learn something.

It was disappointing. There main two things mentioned as 'differences', what that in Silverlight you need to go through some hoops to make cross-domain calls, and that are some differences in the networking stack. The other was that you did not have a Visual State Manager in WPF. I've learned this after the first day of working with Silverlight so it did not help much.

The rest of the presentation was showing things that worked well in both platforms.

If you spent some time working with both platforms you know that there are a lot of other differences that cause pain, so the presentation did not feel honest. In the Q&A section some people pointed to those issues, and the answers were that they are looking to increase the compatibility among both platforms.

The message was that if you need to run on both platforms, start with Silverlight and then move to WPF, which is also obvious once you start working with both platforms.

They mentioned there was an implementation of the Visual State Manager for WPF in CodePlex, which would be helpful, but I could not find it.

Posted: Oct 28 2008, 11:00 AM by aaguiar | with no comments
Filed under: , ,
Clouds

Amazon Cloud offering provides, in beta, a Windows VM and a way to run SQL Server.

The Microsoft Cloud preview basically provides a way to run ASP.NET, what it looks to be Windows Workflow activities, WCF services, and use SQL Data Services.

Microsoft's looks more ambitious, and their architecture is probably more sophisticated and complex and than Amazon's.

However, it looks to be solving the complex problems before solving the simple ones. If I use Azure, I'll need to write my application in a way that can be run in that platform. If I use Amazon's, I can write it in the same way I always did (and of course, I can run all the code I already have).

I'm disappointed that Microsoft does not provide the same services as Amazon. I'm not saying they should not provide an Azure-like platform, but I think they should also provide Windows VMs and SQL Servers.

Actually, I could live without a Windows VM, but not having SQL Server implies a rewrite and I don't think SQL DataServices is the answer to every DB need.

Not everyone is building Facebook. Most of us don't need that level of scalability. But we could use an on-demand platform that provides scalable hosting, and could take advantage of the number of value-added services that can be built on top of that.

So, please, Microsoft, give us SQL Server.

PS: The identity federation stuff in Azure looks very cool.

Posted: Oct 28 2008, 10:54 AM by aaguiar | with 3 comment(s)
Filed under: , ,
C# 4.0

I was in Anders Helsberg the Future of C# presentation (actually, in the overflow room).

C# 3.0 most important feature was Expression<Func>.

C# 4.0 most important feature is IDynamicObject.

I think the scenarios enabled by Expression<Func> are far more interesting than the ones enabled by IDynamicObject.

Expression<Func> enabled LinQ to databases and a large number of cool tricks. IDynamicObject enables easy interop with dynamic languages and reflection. I don't see myself using a lot of interop with ruby/phyton, but I will certainly use it for javascript/reflection.

DynamicObject also provides the ability to intercept method calls so a call like "customer.find_by_customer_id(1)' can be translated to the proper expression, as a DynamicObject implementation can intercept the call and do whatever it wants, like "missing method" in ruby.

Support for co/contra variance is something that should have been in C# 3.0, so it's not big news, and the fact that it does not work with value types is disappointing (if you expect an IEnumerable<object> you can pass an IEnumerable<string> but not an IEnumerable<int>).

Optional and named parameters is a cute feature that simplifies some scenarios, but it's also not a killer feature.

The new C# compiler looks interesting, but the fact that he needed to show that at the end of the presentation was a sign of the weakness of the rest of the stuff. It was necessary to show something cool that was not included in C# 4.0 but will be in the future, to excite the audience. In any case, the new compiler looks like a killer feature and could enable some Boo-like extensions to C# that could change the game.

Posted: Oct 28 2008, 10:54 AM by aaguiar | with no comments
Filed under: ,
More Posts