27 March 2011

Software Design Puzzle #8 - Manufacturing Soaps

Assume that you are an expert in manufacturing many varieties of soaps - bath soaps, detergent soaps and all soaps in the earth. You have a magic recipes of soap making right from procuring raw materials till manufacturing soaps and shipping to stores. There are many processes involved in soap making and there are various flavors for each process. And some of the processes are optional and specific types of soaps. For example, you know that you to have add a lot of scents for bath/toilet soap and lot of whitening material for detergent soaps. 

The puzzle is to design the soap manufacturing with lot of processes/steps and all these processes/steps are sequential meaning that one process cannot start until the previous processes are complete. For instance, the process of shipping cannot happen until you make soap and you cannot make soaps until you form soap base and you cannot start soap base without raw materials.

Can you design soap manufacturing process where one step depends on so many previous steps. To induce your thinking, let us assume that you have the following processes/steps

  • Buy raw materials (can be different based on the soaps)
  • Mix raw materials
  • Form soap base
  • Make soaps
  • Package soaps
  • Ship It
You are free to add more steps but the key is to come up with a process that can be changed dynamically based on soap types that are going to be invented in future :-)

19 March 2011

Interesting Tools on Bytecode Manipulation

The last week, i got a chance to experiment on couple of bytecode manipulation APIs/tools and thought i can share my learning here.

Javassist is one of bytecode manipulation APIs that helps you to manipulate bytecode and it is simpler to use. I wrote a simple method profiler that takes class files as input and instruments the bytecodes in each method. Added, method start time, complete time and measured the time spent in the method. One good thing about Javassist is that you can directly add code written in Java that compiles on the fly while instrumentation. Seems like bytecode instrumentation is bit easier in Javassist. With Javassist, you can also do on the fly instrumentation during classloading phase.

Retroweaver is another bytecode manipulation tool that back ports the code compiled by Java 5 to Java 1.4. If you have written classes (or a third party classes/libraries) in Java 5 and if your production system still runs with Java 1.4/1.3/1.2, you may want to check out this tool. It is really cool to use latest APIs/libraries in old JVM. Retrotranslator is a similar tool.

Bytecode engineering seems to be very interesting.

07 March 2011

Why Contemporary Leadership?

In the ancient times, when locomotive motor was not invented, people who could afford, traveled using bullock carts and the people who weren't able to afford a pair of horses and cart traveled by legs. After the invention of motor and after having undergone industrial revolution, people travel by cars or public transportation. The means of transport has changed but the travel hasn't (moving from one point to another point).

Today, many of the organizations are finding ways for transportation of their organizations from point a (current state) to point b (the transformation state) and they are ready to do anything that ought to be done. They are not ready to travel using bullock carts. I think criticisms and cranky jokes of obsessed Gen Xs on Gen Y are fading away and by now people who will be getting old in near future have to anyway deal with Gen Ys by their sheer numbers. If they continue to criticize, i think it is not going to help the organization at large. Any organization needs contemporary ways of brining in more effectiveness.

These days, the people who join workplace (predominantly often called as Gen Ys) are value conscious and by their virtue of exposure, they tend to make decisions based on how things affect them. We can't question and debate on their way of thinking because this thinking is not unique to Gen Ys. It is part of human evolution. The evolution says, the size of human brain shrinks but its processing power increase every day and the way a 22 year old youth thought 20 years back and the way in which modern day youth thinks varies (greatly?).

While we talk about culture, workplace ethics, work ethics or professionalism, we got to understand that those are things that were once practiced and if we get too much carried away (or adamant) with yesteryears, it will be living in the past or reliving the past and who knows we may fail utterly when we relive. Our thoughts, approach and the way we achieve the vision has to be contemporary. This has to be freshness.

While leading, we ought to be contemporary and forward looking taking good things of the past which just gives enough direction and propulsion needed for the escape velocity and to puts us into the orbit. 

Freshness, productive, creativity and innovation applies even for leadership.

05 March 2011

Democratization of Organization

There are two ways of getting things done - in your own way, dictatorially and in the way others like. With the machines, you can be dictatorial meaning that you decide when the machine has to produce products. Switch on the power, boot up the machine, make sure that all parts work in unison and the product is produced. It is a continuous system where the output is predictable. But in the place where human beings are involved and the factor of motivation/passion more appropriate than fear, democratization or knowing what people have in their mind becomes absolute need. Human beings are discrete systems and they become quite unpredictable as mind and emotions are involved. 

There are two reasons why you democratize anything. First is due to the fact that you cannot make decisions or you don't feel responsible for something that is going to happen and the second reason is that you want to democratize to align your people towards the vision - may it be vision of a company or a country or the mankind. The first reason actually paves way to collective irresponsibility (like the climate change where everyone talks but no one does anything) and the second approach involves a lot hard work (likes of Mahatma Gandhi, Martin  Luther King). In order for effective democratization to become reality, first we have to accept that we can achieve it after a lot of failures. Initially, people tend to misunderstand the process of democratizing before understanding it completely which at the initial stage results to a lot of failure. After the initial failures and if you rally around your people during the failures, the democratization takes shape and becomes effective.

What are the signs of effective democratization? If you have at least few souls who give back far more than what they take back and if the ratio of number of souls that give back to the number of souls take back increases as the function of time, then you are staging yourself for better democratization.