Results 1 to 3 of 3
  1. #1
    mac's Avatar
    mac is offline Member
    Join Date
    Dec 2009
    St. Petersburg, Russia
    Rep Power

    Default 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:

    Java Code:
    Col1	Col2
    keyA	ValueA
    keyB	ValueB
    Their table looked like this instead
    Java Code:
    Col1(keyA)	Col2(KeyB)
    ValueA		Value B
    No biggie, a few code changes and we're in business again.

    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,

  2. #2
    Tolls is offline Moderator
    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.

  3. #3
    FON is offline Senior 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

Similar Threads

  1. how can i do crossover in this tree structure?
    By player123 in forum Advanced Java
    Replies: 2
    Last Post: 02-11-2009, 06:49 PM
  2. HTMLDocument Structure
    By Gudradain in forum AWT / Swing
    Replies: 0
    Last Post: 01-05-2009, 11:05 AM
  3. data structure code
    By vgvt in forum New To Java
    Replies: 1
    Last Post: 01-17-2008, 02:49 PM
  4. Use if then else structure, help
    By paul in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:00 AM
  5. Help with Structure
    By Albert in forum New To Java
    Replies: 1
    Last Post: 07-13-2007, 03:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts