Search code examples
umlmdaplatform-specific

A good aproach to represent A LOT of functions on UML


I am working on a project which requires to have a strong architecture; I'm currently using MDA (Model-Driven Architecture) and i am facing a trouble in the Platform-Specific Model (M1).

I have a class which may contain +30 functions and I just don't wanna put all those functions in the UML unless it is 100% mandatory. So i have a couple of doubts:

  • Is there any way to represent all of those functions in only one? Like: detectionCriterion(Event: e), instead of detectionCriterionA, detectionCriterionB, etc.

  • If I can't short them, is really mandatory to put all the functions on the UML?

I know this may sound a little silly, but i'm asking to someone with good understanding of UML. Thanks!


Solution

  • There are two levels in your question: the UML aspect and the MDA aspect.

    In UML you have aonemodel, and many diagrams can show some selective, partial aspects of the model. It is for example very frequent to have:

    • some high level class diagrams that just show the main classes and their associations. The goal is to give an overview without being overwhelemed with unnecessary details.
    • some more precise design diagrams that highlight key properties and operations of some classes. The goal is to understand the roles and responsibilities of the classes, before their dynamic behavior is detailed in sequence or other behaviorals diagrms.
    • it is not forbidden to also have detailed class diagrams, either to completely document the abstract design or to explicit the details of the implementation including the fields that are used to implement the associations. But not every modeller maintain these, because in traditional development context, such detailed implementation models are quickly outdated and therefore misleading.

    So no, you're not obliged in UML to show all the 30 functions (which would make your diagram unreadable).

    In MDA, if you want to automate the transformations from a platform independent model (PIM) to a platform specific model (PSM) and the into something executable (code?), you'll need to have a very complete model for this to work with forward engineering. Otherwhise you'd be forced to manually review the code generated to enhance it. In this case you'd need the 30 functions described somewhere. But not necessarily in the UML diagram (or at least not in all UMLs). Or at least not from scratch, if your toolset allows reverse engineer code and to make a model based on code to complete the infos that you have in your UML.