Friday, August 29, 2008

Adding abilites to Java's ThreadPoolExecutor

I had a discussion on Java's ThreadPoolExecuter, which seem not to have the ability to block producer from adding tasks when the thread pool's queue is full. I went through some possible solutions and I'm gonna write something about it, so please stay tuned (and if you have something to tip on this issue, say it now).

-----------------
Happy to update:
I've published it, in java.net, it is called Creating a NotifyingBlockingThreadPoolExecuter.

Thursday, August 28, 2008

Google, on the way down

I host my blog at blogspot, as you can see. Today I was editing the draft of the post "ChangeLightBulbWindowHandleEx" when suddenly, between one automatic save to another, the draft just disappeared. Vanished. Gone. I was left with the title alone, no content.

There is no versions saving in blogspot, so I couldn't go to the previous version. Then I thought maybe I can turn to blogspot support and ask them to recover my draft, they might have it there somewhere. Long shot, but worth trying.

I started to look for the e-mail of the blogspot support.
And, after a while I found the link saying
Contacting Support. Great! So I followed it, to a nice page. And another nice page. And another. None of which offered an e-mail or a submission form. All tried to suggest advices for all sort of problems. There was a link leading to Blogger Help, but there again, no e-mail or decent bug report form. BLAH!

Then I started looking maybe someone already bumped into the same problem, maybe there is a hope somewhere. And I got to this
mailing thread at the Google Blogger Help Group.



It could have been funny if it wasn't sad.

Don't you care about your bugs?

I know it doesn't really say something about the business model of google. But it says that they lost it somewhere down the road. Don't you have enough resources to care about your quality?


If I'd have google stock I would sell now.



ChangeLightBulbWindowHandleEx
for Blind Catalan-speaking Spaniard

A response to mistralzonline on "Why is that?"

My friend Alex Romanov, in a recent post at his blog, asked why Nokia is not supporting a synchronization tool for his Mac, while he could easily find such a free tool on the web.

The answer for this question is found in the known article by Eric Lippert, “How many Microsoft employees does it take to change a lightbulb?”, making the math of how much resources are needed for a formal release of a simple thing. And since it takes a lot, you need not get off your course. Which can easily happen.

To summarize, the answer is: Focus.
Choose your lightbulbs!

I was once responsible of a State Machine module for a communication component. With the State Machine module we were providing also a nice editor tool, based on Microsoft Visio. The users liked the Visio editor which made life easier for them. We even thought of adding debug options to this editor to allow the users to run in debug mode in within our Visio tool. At some point I decided to stop the development and support of this tool and instructed all users to start writing their state machines in the raw XML that the module itself received as input. It happened when I realized that we are spending too much time on this nice utility. Every new feature in the State Machine module required a parallel development for the Visio tool. Too much support effort was invested in negotiating features with the users and bugs with the testing team, training and support, keeping up with the Visio versions and more. I realized that we do not have enough resources to support all of this (the resource was in fact one person, supporting by himself both the State Machine module and the Visio tool…, it was, by the way, the man behind mistralzonline from above, so he should know!). Focus is the word. When we realized that we cannot do it all at the required level of quality, we had to cut. And it’s better to cut the utility Visio tool rather than the module itself.


When Nokia decides not to provide the tool for synchronizing one of their models with Mac, it’s because they believe that with the resources they would put in it, they cannot decently do a good job. It’s not only development, it’s the entire life cycle, including support for users who get stuck (and do it better than google, a post on the horrible google support will follow soon).

Now, Nokia has the option of managing a community or at least pointing to the available solutions on the web. After all, there was such a free tool out there. It is interesting to note that not many commercial companies officially manage such a development community or point at available supporting tools related with their product. Sun does have the java.net, but it’s more like an open source arena.

Why is that?

Because for Nokia, pointing at a tool, even if accompanied with the common disclaimer waiving any liability or guarantee, still means taking responsibility. If the tool infringes privacy, causes loss of data or just simply doesn’t work right, the furious public will come to Nokia. To take such a responsibility Nokia would have to thoroughly test the tool, which brings us back to square one. This is why they choose to refrain and let you pick it up by yourself, which as appears you can do quite well.

Tuesday, August 26, 2008

Rolling the Dice - the Cube Project for Silverlight



I am teaching a "Product Workshop" course at the MTA college in Tel-Aviv.
Usually students submit something that can be used as a "black box" product, like: a web application managing event invitations, a simulator for physics rules and many other nice things.
Whenever a student wants to create a library or a toolkit (that is, something to be used by other applications), I urge him or her (well, it's a him, let's stop with this political correctness, when it is a she the product is a very nice well designed, all screen pink, web application for match-making...*), well, I urge him to put it out as an open source.

So here is something recently created by my student, Itamar Kotler:
http://www.codeproject.com/KB/silverlight/CubeProject.aspx

It's a component for creating a rotating cube out of 6 photos, right into your web site.

Funny that it is not inherently supported by Silverlight (there is something in Silverlight but the argument is that it doesn't really support full rotation through all possible angles). I guess it will have soon a decent substitute as part of Silverlight, which will probably disappoint Itamar. But then again he can always argue that he drove Microsoft to implement and present a decent rotating cube.




* Just before I'd be accused of being a male chauvinist swine, some of the best projects I get are from women. And I can live with pink screens.

Friday, August 1, 2008

Do you have an API?



This is so basic, yet still ignored so often.

When you buy a SW tool or thinking of developing one, one of the first questions to ask is: is there some kind of API exposed? CLI (Command Line Interface)? Web Services Interface?

A product without a clear good API means that you cannot customize it to your own needs, it's a "take it or leave it". Of course, you can ask for features and then wait in line.

A good API must allow to preseve states when needed. Suppose I want to perform a series of operations, like for example a chain of queries, I need to be able to send the 2nd query for filtering the result set without reminding the tool what was the first query. And the results should probably be cached for a specific amount of time. So I'd probably need some session ticket, request Id or alike.

With a good API I can use the tool in things that were not originally planned, and still do well. And when a question arises: does the tool know how to do this and that, the answer would much more easily be: yes, it does have the ability to programatically allow it on the client side.

Now if the product doesn't have an external good API, it probably says that it is not well designed with a clear separation of a Model View Controller (MVC) architecture.

Bottom line

Even the most graphical product MUST have a model and an external API.
Start always by thinking on the API or CLI version and ignore the presentation layer.
And think twice before taking a product that can be opearated only via its specific UI environment.


Think - MVC, MVC, MVC, MVC, MVC, MVC, MVC, MVC, MVC ...