5

I am working on a project in C++ that has the classes Driver, User, and Admin. I am including this classes in the UML diagram of my project. Now, there are many client functions in my project which do not belong to any classes but are placed in specific header files according to their functions. For example, I/O functions are in a file called IOFunctions.h.

Do I need to add these client functions in the UML? If so, how should that be done?

2
4

Do I need to add these client functions in the UML? If so, how should that be done?

The answer depends on what your purpose is for the UML.

Most people use UML for a high level overview aimed at future developers and maintainers. In that case, most of those details can be left out - and it is your choice which details to leave out.

If I do this, I might add a single box labelled "I/O Functions" without detailing which ones. Or I might create a separate diagram to detail them. But I certainly won't mention each and every function in a single diagram; Too many details will only cloud the picture.

If your purpose is to mention every single detail of your project in UML, then in essence you are writing code in a graphical way. Every attempt at that has failed, including UML. So I would strongly advice to rethink why you are using UML in that case. [1]

I'm sure there is an official place to put those details, but in practice barely anyone cares enough to remember where.


[1] Unless this is a course, and your teacher requires you to do this. In that case, put those functions wherever he says you should put them.

2
  • 1
    Uml is best used to communicate design decisions. It tends to go out of sync with code quickly so has limited use for documenting those decisions. – candied_orange Dec 19 '16 at 0:24
  • @Sjoerd, thanks for your answer. Yes, this was a class project, but I also wanted to have an idea about what do to about cases like this in the future. – Shabbir Khan Dec 19 '16 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.