Thursday, April 15, 2010

J2EE talks

As my trigger-happy brain thinks rapidly and shoots ideas, here's a piece of conversation I have with the J2EE objects in my mind:

A pair of young baby-eyes stare up at me, it's the new bean am writing, and starts:

"Hello God, Why are you creating me. Where will i live?"

"Oh, hi sweetie. Am creating you because i need you to store and take variables to the JSP."

"Don't hi-sweetie me! You could have done that with that other guy there! you don't have to create me. what a waste of JVM!"

"No, that bean belongs to the other controller. I cant use it here, the session information will get garbled."

"Whatever! But then, why is this member here static? I have to carry the burden with my name in all the requests."

"Dear bean, it's static because that's your name string you carry in the first place, that's what people identify you with in the session."

"Ok, so why do i need this meth ..."

"Wait till you instantiate once or twice, you will know the answer to most of your questions."

"You are being evasive! Where will i live, you havent answered that"

"You will get created when this controller gets called. Don't worry, you will live in the session that's a good place to live in actually, your neighbors are all pretty good guys and well taken care of"

I change the editor for now to escape, and I jump from the teapot directly into the fire. Now, I need to be real careful, here's one rough guy: The controller.

(Breathes down my neck) "Listen, I know you are god and all, but am the supervisor here who has to do the dirty work under this container manager. He doesn't give me enough resources, hangs me onto a thread and expects me to be thread-safe. For your sake, do the MVC stuff properly. Now, where is that new bean you promised me?"

"Well, am in the process of creating him. If only you can wait .."

(loses control): "wait? WAIT? you are asking me to wait? I might be pulled up anytime this server guy starts the engine. You are already late. I needed the bean YESTERDAY!"

"And some nights I eat. Chill, am working on it. You will get the bean, take a break"

"Listen, man, you are paid only because you can code with twenty fingers. If I get bootstrapped, or if web.xml dynamic-loads me, I will not take the heat. I will NullPointer your bean and he will be the fall guy"

"Jeez, he's just a kid. Leave him alone."

"Ah, i need a coffee before the engine starts up. Now, get going and give me the bean fast."

I decide to pay the backend guy a visit to check on the DB attribute. He is a real heavyweight champion and weighs tonnes. Atleast he is not mainframe!

(Slowly rolls over and grunts): "Ja. I see you. What's up?"

"Just checking out. Everything OK?"

"Guess so. When are you migrating my lower half to plain java? I get confused with the object model and its links".

"I told you we will outsource it"

"Look, I know am the responsible one, and have to take it slow and steady, but I have my limits. The connection pool isn't holding up, and I would rather be java in a j2EE server. Got it?"

"Gotcha. By the way, can you check up on this attribute for me? This new bean I am creating ..."

(Rolls his eyes): "Another new one? Holy creeps, isn't your app already bloated up? I am serving atleast three other folks here dude!"

"I know, I know! Just put up with this one little guy."

"I know how the little ones grow and put on weight over the releases. Anyway, forget it. Gotta go, someone's pulling my toe with a JDBC request".

"Ok, don't forget to memo me the attirbute. Bye"

(Whistles) "Atleast you're asynchronous ..."

Now, back to bean.

(Starts the moment he sees me) "Ah! there you are. This method is calling that private method, I would say that's a bit too private. Can't you leave the dirty things for a helper class?"

"There is no time for a helper. Help yourself. Shut up and eat!"

I put them all in silent mode with the -s option, and begin typing at a furious pace. Life goes on ..