Wednesday, December 06, 2006

xstream (note: extremely geeky post!)

i finally got something figured out at work. it's been making my head spin. amidst all that "other" operational work, i've been tasked for the past weeks to focus my energy more on something that's "bigger" in a sense. to make our lives easier (i seriously didn't see how it can) we decided to employ use of XStream and JSON to fit into our existing framework. it'd been fun. up till my figuring out of XStream's feature for doing .fromXML(java.lang.String) that is. i believe that for the past week or so, up till today, i'd been trying to figure out how that lib can convert a set of XML nicely into a neat and tidy Java object without me pulling (much of) my hair out. i've finally sorted that out today at least. and i'm rejoicing... briefly. now comes the real task of building up the rest of the app and rushing things out. we're already waaaaay behind schedule and the boss had (nicely) asked me not to go on leave this friday. so be it. let's just suck it up and move along now. these things are inevitable.

but heck it was really fun figuring out data-binding from JSP to a complex java object via XStream. i was thinking in way too deep and complex but surprisingly XStream was less complicated than i'd thought it was. so i had back up a bit, look at my codes while my colleague looked on (i'd asked for his help because i'd practically surrendered figuring out) without saying a word. and then that was when lightbulb in my head blew a fuse and got it sorted out. life's just plain strange like that. the answer always seem to show up when you are almost about to give up. XStream had simply require that i set an alias (not this Alias though!) for each of the children objects in my complex "parent" these other complex objects come under. and there i was thinking of using addImplicitCollection(java.lang.Class, java.lang.String) and whatnots. my jsp was being tweaked so much the codes seemed to grow longer in a neverending fashion.

fortunately, things sorted out and i'm happier now.

most programming project codenames have a pun in them, i realised. XStream, for example, was probably meant to be read as "extreme" in a sense... geeky projects tend to sound cool like this for some reason.

*for us... it's JAXME =x*

No comments: