Thursday, January 15, 2009

Handcuff Notes: Bigger Picture

One problem often found on Internet: juicy and linkbait-worthy subject is, unfortunately, totally useless for search. One example: a nice article on Java specifics with a title "Die, You Gravy Sucking Pig Dog!".

But I digress...

Like I said, nice article. Too bad it never mentions the concept of object life cycle management.

There are two realms: the language (which works just fine in Java and, no doubt, other modern languages), and the application code, which allows the programmers to write Fortran everywhere.

The horrors of improper life cycle management are formidable.

I've seen cases when an instance variable is used to hold the temporary result of execution inside of an object used by many threads, without any regard to transaction state (guess what happens when the load goes up).

I've seen cases where the complete set of application configuration files was being read by every spot where a configuration value was required - dozens, if not hundreds of times per request - for configuration that changes once in an EAR deployment.

And all in between.

Next time you start doing something complex, think of object life cycle and how it reflects on the object API. It'll save you a lot of grief.

1 comment:

  1. People who write code that don't read Coding Horror, they watch TV... Just saying...