umldiagrams

Not exactly following what is depicted on project UML diagrams


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?


Solution

  • 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

    The drawback is that you might need to correct the automatically generated diagram. Each time you generate it.