Categories
Technology

Evaluating in-house frameworks

In-house frameworks

The very mention of this word brings out different memories and emotions for different people. More so if is a framework for be used within a large company, by a completely different team than the one writing it.

To make sure that the next time you hear this word, you have positive memories; use the evaluation sheet below, before adopting the framework. If you are the one writing the framework, make sure you have good answers to these.

Why in-house frameworks?

Before we begin, let’s recap why we need in-house frameworks in the first place.

Categories
Technology

Dumping thread stack trace in Java & .NET

Multi-threaded Java practitioners know about the indispensible ways to taking thread dumps to see a snapshot of what’s happening in the JVM, and resolve ‘hang’ issues. There are plethora of options, ranging from simple command line tools and utilities to nice GUI applications to writing some code in your application. A sampling of such options:

Stack trace in Java

Command Line

If the application is running as a console application, you can try one of these:

Sending a signal to the Java Virtual Machine

On UNIX platforms you can send a signal to a program by using the kill command. This is the quit signal, which is handled by the JVM. For example, on Solaris you can use the command kill -QUIT process_id, where process_id is the process number of your Java program.

Categories
Technology

Beware of the clone

Why Clone

In this world of concurrent, multi-threaded programming, functional style of programming makes more sense. And one of the key tenets of functional programming is immutability. Even in OO languages, a few benefits of FP can be derived if the objects are made immutable.

Clone gone wrong

We follow a similar approach in our application. But this is not always possible, especially the mutable by default approach of Java. To overcome this, we pass around clones of instances, instead of the instance itself. This works in most cases, but we experienced a very subtle bug last week, where one thread was changing the values on a clone held by another thread, in spite of having no reference to it.

Categories
Education Technology

Rock SOLID software construction

SOLID - Software Developement is not a game of Janga
Software Developement is not a game of Janga

I spent last two weeks deep diving into code written by our contractors and writing some test against the same. This was a pleasant break from my regular duties of an architect. As an architect I am always trying to ensure the code follows pragmatic design principle and I really dig SOLID and TDD.

<aside>

S.O.L.I.D. (a.k.a. S.O.L.D.I.)

The charm of Uncle Bob is, he can give a concrete shape to abstract ideas. I have been following the principles laid out by SOLID for some time, but he makes them fit together and remove ambiguity.

So, what is SOLID principle?