JSON Over Mailto

First thing first, don’t take the solution in this post serious.

I was working on a project where we want to make our web-based application perform some actions in Microsoft Outlook. It’s not a common behaviour but it is probably workable in a very controlled place like my firm, where almost all the users having same set of applications.

Due to browser sandbox security, communication between web app and host application is not straight-forward. So my initial thinking is to use some JavaScript interact with ActiveX (only IE can use in this case) then further perform actions from Outlook with a Outlook add-in.

My architect is a genius, he suddenly suggested why not use mailto link, since all the users will use Outlook as their only E-mail tool.

I have to say before I started to work on it I felt it very hardly work. But after a few hours trying I found out it’s actually possible to let Outlook add-in to capture the special mailto and do some funny actions after that. The only problem I have is that if user’s Outlook is not opened first, then he will see a new mail window with special mailto address in. This is because Outlook start new mail window first and only load add-in after that.

MSDN has a good tutorial on Outlook plugin here.

So next thing is how to pass data in Outlook, and since I’m familiar with Web application and always work on web, JSON just comes to my mind. So in the end I embedded JSON string in mailto URL and created a new pattern which my colleague called “JSON-over-mailto”.

It’s a really fun experience to do such unusual practice, and also┬árealize┬áthat Microsoft tools are really powerful.

Last thing, this is not a common practice and only work in a special close environment. But if you want to have something fun, just go ahead and try.

Things to explore

There are a couple of things in my mind to explore in next a few months. Just to note them down before I get lost.

A new pattern – CQRS (Command & Query Responsibility Segregation)

I heard of this term first from my company’s architecture design talk, and heard it again from Uncle Bob‘s presentation. Thankfully and surprisingly, Microsoft has published a free book about CQRS and Event Sourcing (ES) online here.

A new language – Clojure

I’ve heard this language long time back but never really look into it. But recently I have (maybe not only me, the whole community has) growing interest in functional language and scripting after diving in OO program many years. Again this was mentioned in Uncle Bob’s presentation and I feel I should at least try something out from it. Another reason is that it’s based on Lisp – a (old) programming language I have special passion on.

A few JavaScript frameworks

I used to work as a backend coder proudly and look down those UI works until in my previous project I worked a lot on JavaScript stuff, in which I used jQuery and JavaScript micro-templating heavily. From there I also learned V8 engine and node.js, and realized JavaScript has changed dramatically over the years and not only a UI script language like Netscape time. The open-source community has grown fast. More and more techniques/patterns/frameworks emerged and evolved. Among them I have particular interest in below:

  • MVC pattern – backbone.js – A nice online tutorial can be found here.
  • AMD (Asynchronous Module Definition) – require.js – A good article here and youtube video here.
  • Micro-templating – Hogan.js

And just one more to read: Resig’s new book – Secrets of the JavaScript Ninja

[Update 1] (19 Feb 2013)

Today I came across another interesting article when searching for require.js
http://tomdale.net/2012/01/amd-is-not-the-answer/

And two answers to this “not the answer”:
http://tagneto.blogspot.hk/2012/01/reply-to-tom-on-amd.html
http://geddesign.com/post/15994566577/amd-is-the-answer

Hello world

This is my first web hosting as well as my first personal domain name. I will start to record my daily life here, as a software developer, as a (classical) music lover, as a husband. I used to have blog on different places like MSN Space and WP but later I became quite inactive. This is a new start, so let me start my blog with a typical programmer way whenever starting to learn a new program language:

Hello world.

The first thing I get excited is that with a personal domain name finally I can name my code with proper package name: com.wilsonwuz.*