Pre-Flight Java Coding – Clone()

So after a very minor break, its back to the airport cycle of work life, which in itself bring a degree of fun and games 😉  Before flights, I like to ensure I’ve got enough reading and coding material.  Hence today, its a bit of pre-coding to ensure I’m ready for tonight’s flight, and a re-cap to the coding challenge I was working on a few weeks ago.  Very quickly this morning I ran into the classic clone() method madness of Java.

Citation From Josh Bloch’s Effective Java:
“The Cloneable interface was intended as a mixin interface for objects to advertise that they permit cloning. Unfortunately it fails to serve this purpose … This is a highly atypical use of interfaces and not one to be emulated … In order for implementing the interface to have any effect on a class, it and all of its superclasses must obey a fairly complex, unenforceable and largely undocumented protocol

So with a sensible(ish) clone method written, I’m ready for a bit of reactive coding tonight, which if I have time will also incur some DAG work on the server.


~ by mdavey on November 10, 2013.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: