Microsofty Kids Around (3) Mark Junior

Actually this baby is not so Microsofty currently, but his father Mark is so Microsoftily crazy, so everyone believes that he will become so very soon.

mark-junior-1

mark-junior-2

His father, Mark, was an excellent developer / development lead of Microsoft projects, as well as my buddy. We discuss a lot of things about him. And here are the conclusions:

  • His father complained that, according to my post, constructor is better to be lightweight, but his constructor is not so well and ran for 280 days…
  • Some properties or behaviors were override from parents, which would possibly break Liskov substitution principle.
  • Obvious side effects, like making parents very nervous and tried, etc.
  • Resource costly. A large quantity of resource exhausted to construct just one instance.
  • He is not covariant or contravariant.
  • He implements neither System.IComparable nor System.IComparable<T>. We cannot compare him with the other guys’ babies.
  • He is not atomic. He can change during the runtime. I think he is more like the dynamic object in .NET 4.0, supporting late bindings of behaviors.

I suggest his parents to implement this interface for him:

public interface IAffluent
{
    void GetGiftAround(decimal money);
}

Finally we discussed the variant relationship of the stealing stuff behavior and stealing drink behavior:

// Stuff is the base class of Drink.
internal class Drink : object
{
}

internal class Program
{
    // The behavior of stealing stuff.
    private static void StealStuff(object stuff)
    {
    }

    // The behavior of stealing Drink.
    private static void StealDrink(Drink drink)
    {
    }

    private static void Main()
    {
        Action<Drink> stealDrink = StealDrink;
        Action<object> stealStuff = StealStuff;

        // Contravariance.
        Action<Drink> contralvariance = StealStuff;
    }
}
You can see more details about variances in my posts. And you can see more photos of the baby here.

No Comments