0
votes

A friend of mine and I work on a small app that makes reads from a database on a remote server. I wrote a quick diagram in Visio which describes the relationships and interactions between components. However, we cannot agree on which direction the arrow from the data access layer to the database should point.

My friend believes it should point from the DB to the access layer, because the DAL cannot exist without the DB, and because the DB is the one supplying the DAL with information.

I believe the arrow should point from the access layer to the database, because the DAL knows the DB exists, and requests info from it, not the other way around.

Which direction is correct, and why?

1
which of the following examples uml-diagrams.org/examples/online-shopping-example.html resembles most your quick diagram in Visio?xmojmr

1 Answers

1
votes

Probably you're right. :)

I say probably, because the answer depends on the diagram you used, the elements and the relationship type.

My first guess is that you are using component diagram, with 2 components (for DAL and DB) and dependency between them. In this case, you are right and your explanation is correct - DAL makes the request, therefore depends on the DB. DB does not know about the DAL.

Other scenario could be to show the information flow between these components. Although information travels both ways, theoretically it is correct to show how the data set travels from the DB to the DAL. It would fit your friend's reasoning.

In UML and modelling in general it is all about the abstraction and point of view. Be sure to always agree the point of view (or modelling context) before you do anything else.