K
kgalligan
I manage a small IT group in my company. I started as a developer and
I still do some development work, so it seems like I'm a good candadite
for this job. Strangely enough, I feel like I'd have an easier time if
I wasn't, because a lot of the time I'm looking at my peoples' work
thinking, "well, maybe it should be like this...", but I digress.
Yesterday I looked at some code that was doing basic table maintenance.
There was an edit and delete link for each row, and an add at the
bottom of the table. The delete was supposed to just set an 'active'
flag in the table for a logical delete.
If I had built this, I would've had the edit link and the delete link
send the database unique id to the code (struts action in this case),
and do whatever needed to be done. Instead, this person passed every
other field in the table to the delete link, except the id. I looked
at the code, and I guess the idea was to pass in all the field values,
including the 'active=false', and do a global update with all of those
values. Now, to be clear, this WILL WORK. However, fill in the
blanks. What happens when we add another field? Are we sure the
values are properly html encoded? What if there's a newline in the
value, and it isn't properly represented? You get the idea. I just
wouldn't have done it that way.
That got me thinking. Is there some sort of design pattern book for
web applications? It looks like most of the stuff out there is in a
programming language camp (web apps for php, web apps in .net, web apps
in java). I mean, it would be great to have one that did Java with
Struts, and had good design patterns, but I'm less concerned about the
specific language.
The person who did this is new, so I think what I need to do is just
better document my ideas on design, but I think there's a lot of stuff
that's pretty obvious and I should be able to point to a book and say,
"do this". Any thoughts?
Maybe some ideas on my managment process? I've heard of some shops
where one person will design everything out in detail and another coder
will just fill in the blanks, but we're really not that kind of place.
I'd like to feel as though I can hand off stuff at a higher level and
get back a decent piece of code.
Thanks in advance.
I still do some development work, so it seems like I'm a good candadite
for this job. Strangely enough, I feel like I'd have an easier time if
I wasn't, because a lot of the time I'm looking at my peoples' work
thinking, "well, maybe it should be like this...", but I digress.
Yesterday I looked at some code that was doing basic table maintenance.
There was an edit and delete link for each row, and an add at the
bottom of the table. The delete was supposed to just set an 'active'
flag in the table for a logical delete.
If I had built this, I would've had the edit link and the delete link
send the database unique id to the code (struts action in this case),
and do whatever needed to be done. Instead, this person passed every
other field in the table to the delete link, except the id. I looked
at the code, and I guess the idea was to pass in all the field values,
including the 'active=false', and do a global update with all of those
values. Now, to be clear, this WILL WORK. However, fill in the
blanks. What happens when we add another field? Are we sure the
values are properly html encoded? What if there's a newline in the
value, and it isn't properly represented? You get the idea. I just
wouldn't have done it that way.
That got me thinking. Is there some sort of design pattern book for
web applications? It looks like most of the stuff out there is in a
programming language camp (web apps for php, web apps in .net, web apps
in java). I mean, it would be great to have one that did Java with
Struts, and had good design patterns, but I'm less concerned about the
specific language.
The person who did this is new, so I think what I need to do is just
better document my ideas on design, but I think there's a lot of stuff
that's pretty obvious and I should be able to point to a book and say,
"do this". Any thoughts?
Maybe some ideas on my managment process? I've heard of some shops
where one person will design everything out in detail and another coder
will just fill in the blanks, but we're really not that kind of place.
I'd like to feel as though I can hand off stuff at a higher level and
get back a decent piece of code.
Thanks in advance.