Connection between Controller and other classes in the class diagram

Asked

Viewed 111 times

1

I am modeling a project through the UML class diagram, this project is guided by the MVC standard, so that in a given Controller method I receive information, I instate a new object and insert this new object in a chained list. My question is: is there any association between the object being inserted in the list and the Controller in the class diagram? First I had thought that the association of each object in the list would be with the nodes, but for a second moment I remembered that I am instantiating the new objects in the Controller and just calling the list method that will make it be inserted into this data structure.

Following is a simplification of the Controller class with the insert method in the list:

public class SACMarianaController {

    public ListaEncadeada listaProdutos;

    public SACMarianaController(){
        this.listaProdutos = new ListaEncadeada();

    }

    public Produto cadastrarProduto(String nomeProduto, String tipoProduto, Date dataCadastroProduto) {
        Produto novoProduto = new Produto(tipoProduto, nomeProduto, dataCadastroProduto);

        listaProdutos.inserirFinal(novoProduto);

        return novoProduto;
    }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.