Mvc – Package diagram for an MVC patterned project

class-diagramdesignmvcpackagesuml

We are required to make a package diagram for our senior project. Since our project uses MVC patter design, we created an MVC class diagram, now, our problem is in creating the package diagrams from our class diagram.

Is it possible to have packages with MVC at the same time? so it would be something like this:

Package: Account

  • Account Model
  • Profile Controller
  • Registration Controller
  • Profile View
  • Registration View

These are the controller that cannot exists without the Account model, so I included them.

Thanks in advance!

Best Answer

First thing you have to do is to decide about the semantics of your UML packages. UML does not define any clear semantics, you have to define one that suits your needs.

For example, a package could be a layer in your software (i.e. model layer, view layer, controller layer), so if that is the semantics you pick, this will obviously fit to MVC. I guess that is not the semantics you have in mind, otherwise you would not see any problem here.

A different possible semantics is a namespace, a component, a library, the deployment packaging, or whatever things you want to group together. This is a different point of view, and may or may not conform to the MVC view. If this it doesn't, you may consider making two diagrams, one showing the MVC view and one showing your specific package view.

Related Topic