Search code examples
frontendbackenduml

Should I separate FE and BE in UML diagrams?


I am currently working on designing a web application and I'm wondering whether I should separate the frontend and backend in UML diagrams or if it's acceptable to combine them.

Specifically, I would like to know the best approach in the following scenarios:

  1. When trying to understand the overall structure and flow of the system.
  2. When aiming to clearly define the detailed design of each part.
  3. When creating different types of UML diagrams such as use case, class, and sequence diagrams.

I believe separating the frontend and backend might be beneficial for complex systems, but combining them could also help in understanding the overall flow.

I would appreciate advice from those with experience in this area.


Solution

  • The fundamental question in the modeling is to be clear about the scope of the system.

    Intuitively, I'd see that the system is a whole, including front-end and back-end. So it's one system. While you may want to separate components at some stage, you may also need some diagrams where you show both sides, in particular regarding the interactions between the parts.

    On the other side, the system's use-case diagram should provide the use-cases from an actor point of view, independently of the internal structure of the system (i.e. independently of FE/BE). But still, you could have some more detailed use-case diagrams that are for the scope of a component, that allow you to show the separation of concerns that is hidden at the level of the overall system.