This has been confusing me for quite some time. I have an app which is already done, but since the client is looking for a detailed documentation of it, I now have to create diagrams. The point where I get so confused is, whenever I make the diagrams, it just seems that the diagrams are not as exactly the same as what my coding looks like. For example, on my class diagram, I have a class called 'announcements' and under that class is a method which getAnnouncements(). But in actual coding, you'll never find a method that is named getAnnoucements() since I opted to not create a method for it and instead put the codes directly on the main class. I know it's not a good coding practice, but what if? So these are my questions: Do I really have to follow what is on the class diagram? Or since I'm using reverse engineering, do I have to follow what is on my code and make diagrams of it?
Asked
Active
Viewed 41 times
0
-
I can not completely follow your explanation. Can you add a code example? – qwerty_so Aug 06 '16 at 22:14
-
@ThomasKilian let me just put it this way, since I'm using reverse engineering, can I make diagrams without exactly basing what is on the codes that I have already made? I'm trying to make my diagrams understandable to the reader as much as possible. If I'll base it to my code classes, it might be confusing to whoever reads it. – Glen Aug 06 '16 at 22:28
-
I neither judge your code nor approach to object oriented programming, however on one of best trainings I've heard something like that (and I fully agree to that) "If the first thing you do when you're building a class code is generating getters and setters for all attributes - you do not follow object oriented approach". Of course in most cases using methods outside the class accessing the attributes is even worse. – Ister Aug 07 '16 at 08:39
-
What you're asking is opinion based. One can argue pro and con. – qwerty_so Aug 07 '16 at 08:51
-
Thanks for the answers guys. Not really familiar with documenting my system. Gonna have to get used to this – Glen Aug 14 '16 at 14:29
1 Answers
0
If you're making a documentation and you're making a UML at the code level follow whatever you actually have in the code.
The benefit of this approach will be that
- you really have diagrams similar to your code
- you (and your client) will be able to recognize parts of poor code (i.e. not following various standards) - like those you describe. It gives chance to improve it in the future
The drawback is that you might need to correct the automatically generated diagram. Each time you generate it.

Ister
- 5,958
- 17
- 26