Results 1 to 3 of 3
- 12-22-2009, 03:27 PM #1
UML, robust code, structure questions
The deeper you go into the woods, the more lumber you see, they say. I started with a problem of having to compare contents of 'n' files to a 'master file'. (key value pairs) I went through a bunch of iterations until i got to the point where program not only did what i wanted it to, but also did it fast enough and produced a nice enough html result.
Then comes days 2. Now the problem is that i need to build on the existing code to extend my program to compare contents of 'n' tables where data is to be looked at as a combination of key value pairs as well. So, i dive in and ... done
But then i find out that my idea of Key Value representation of data is different from that of my customer. Silly me, i thought this would work:
Col1 Col2 keyA ValueA keyB ValueB
Col1(keyA) Col2(KeyB) ValueA Value B
Throughout this process i reused the core method that does actual comparison and code that produces a report. Had to make a number of changes though ..
So ... are you wondering if there is a question anywhere here yet?
Question is this: I have over 1100 lines of code written by someone whose Java experience is about 1 month. I fear that with further improvements my code will make it unmanageable and difficult to maintain. What approach would you suggest in making said code more robust and structured? Is there a software that would consume my *.java and produce UML code? May be something else that would give me a high level code overview that will expose things i otherwise would miss?
Thanks for reading,
- 12-22-2009, 05:03 PM #2Moderator
- Join Date
- Apr 2009
- Rep Power
There is stuff out there for producing UML class diagrams. There might be plugins for Netbeans or Eclipse these days. I suspect you'll still need to pay money for something that'll reverse engineer sequence diagrams, though.
Since you're only dealing with 1100 lines of code, now is probably the time to simply rework it properly.
- 12-22-2009, 11:06 PM #3Senior Member
- Join Date
- Dec 2009
- Belgrade, Serbia
- Rep Power
To be honest i don't think UML will do you any good at this point.
Be sure that you have managed to :
Completely separate data representation in files and algorithm that you have written for comparing purposes.
It is good that client gave you unexpected format so now you can rethink what part of your code you HAVE to change
and ask yourself can u isolate and encapsulate that change so it never ever
ruins your code again
2. go trough some very bacis OOA&D principals and catch useful stuff like
never add to much responsibility to one class, program to interface not implementation, learn how to use interfaces so you can change behaviour in run-time, class should have only one reason to change principal...
be patient things like this comes after tons of lumber
- By player123 in forum Advanced JavaReplies: 2Last Post: 02-11-2009, 06:49 PM
- By Gudradain in forum AWT / SwingReplies: 0Last Post: 01-05-2009, 11:05 AM
- By vgvt in forum New To JavaReplies: 1Last Post: 01-17-2008, 02:49 PM
- By paul in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:00 AM
- By Albert in forum New To JavaReplies: 1Last Post: 07-13-2007, 03:27 PM