Question

I'm trying to model a system where I have directories with files. A directory contains files as well as directories.

I found a good method to represent a tree in an SQL database (http://falsinsoft.blogspot.com/2013/01/tree-in-sql-database-nested-set-model.html) -- the article describes the method named "nested set" but I have problems on how to model it in UML (class diagram).

Was it helpful?

Solution

Here is a class diagram that represents the situation:

enter image description here

Compositions are used to reflect the fact, that if a Directory is deleted, all its contents (subdirectories and siles) are automatically also deleted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top