I have been asked on a school project to show the UML diagrams I used - if I did - to realise the project. But the project I was working on was in C and has been functionally programmed. Thus I want to justify that using a class diagram when not using object oriented langage was pointless, but I am afraid that this is not true and haven't been able to confirm this hypothesis. It seems pointless to me but I'd like to know if it is the case, since may be thinking the code in a OOP way could help understanding how it works.
Is there any benefits regarding the way to think and build a functionnal program in using a class diagram ?
UML isn't only class diagrams. Most of the other diagram types (Use case diagrams, activity diagrams, sequence diagrams...) are perfectly applicable for a purely functional programming style.
Class diagrams are one of the most useful types of diagrams in UML as they clearly map out the structure of a particular system by modeling its classes, attributes, operations, and relationships between objects.
Use Case Diagram As the most known diagram type of the behavioral UML types, Use case diagrams give a graphic overview of the actors involved in a system, different functions needed by those actors and how these different functions interact.
It helps software developers visualize, construct, and document new software systems and blueprints. UML is used to create static structure diagrams based on a variety of engineering practices that have proven to be successful in the creation of complex systems.
Of course, yes. The use of class diagram is not so extensive as in classical OOP, where very often having a class diagram means only automatic coding routine is left, but still it is very useful for:
And even if you haven't any OOP features supported, you can always profit from at least the first point.
Really, the only possible use of the class diagram, that is forbidden by functional programming, is creation of methods with side effects on instances. And that is not much connected to the class diagrams. On the contrary, class diagrams are not mentioned for modelling of that. Rather the Composite Structure Diagrams are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With