Wednesday, 24 March 2010

a fire-fighting request - episode 2

continue on the previous post,
as we are waiting for task assignments we go on to dig deeper into the codes,
just to discover even more code smells.

- hardcoded SQL statement and query logic in JSP
- string comparisons using "==", which leads to unreachable blocks of code
- though JDBC connection factories(see previous post) are in place, there are still direct inline creations of JDBC connection.
- direct dependency from domain object to JDBC API
- and....what the hell is this?

Tuesday, 23 March 2010

a fire-fighting request

i was transferred to another project this morning on an urgent request to meet the schedule.
the project was in charged by the in-house development team of my client,
it is a straight forward web app with member subscription screen flow.

it was after i checked out all the codes to only realize that this project is such a disaster.
firstly with the requirements given i dont really expect a sophisticated architecture,
but a plain servlet + jsp web project started in 2010 indeed surprised me.

as i glanced through the code there are lots of code smells,

- extremely unorganized packages, looks like every one of them was doing his/her own project.
- JDBC connection factory classes (yes, there are more than one, checked in by different developers, apparently they are not from the same university so the coding style are different) with hardcoded connection properties.
- there are even business methods defined in one of the factory classes above.
- SQL statements by string concatenations (you think SQL-injections are so 90's huh?)

just to name a few.

Monday, 22 March 2010

why you should not deliver a service client...

every time you provide a service to external party,
chances are that they will request a client for your service,
for whatever reason.

apart from wisdom by authorities,
i hate delivering a service client when one request it with lazy reason.

the following is a conversation in IM between me and a developer from my client.

{ background: part of my project involves providing a RESTful web service in JSON for several lists of reference data }

client: hi i received ur email about the jason web services
me: (ok, jason is a male's name, and JSON is the format.)
client: but a got a 404 when i tried http://xxx.xxx.xxx.xxx:8080/JSONXxxService/getXxxxList
me: it is /YYYY_SERVER/JSONXxxService/getXxxxList, if you have read my mail carefully.
client: actually, i tried that too, got a 405 instead.
me: well, did you tried that in your browser?
client: yes, haha
me: as i have mentioned in the mail, it only supports POST.
client: oooooo, i just figure it out.

(a while later...)

client: would you help to get the full set of those lists since it needs some time to develop the client.
me: what lists?
client: all of them.

I would be willing to help, indeed, if I have your salary too.

Friday, 19 March 2010

真的假不了, 假的真不了

patrick:[喂!! 個System又死啦!! 成日都死ga!! 又話咩7x24咩cluster ge? 個Cluster 用來擺ga? ]

K大師:[我想同大家講, 個system生活得好好, 唔駛為佢憂慮.
但係講到底, 個system 係咪完全無起到變化呢? 呢一點係無可能的.
但係想深一層, 有邊一個system的生活係完全無變化ga le?
所以~當你係用個system時遇到一些微妙的變化, 請你唔好驚! 唔好亂! 唔好放棄!
因為真的假不了, 假的真不了~
多謝大家的支持,關懷同鼓勵!
] (之後好型咁行開去)

patrick: [OOOOOOOOOOOO] (企係度目送大師離開)