I find it a little strange ClienteJuridico
, and ClienteFisico
, inherit from Pessoa
. Not totally absurd, but it seems conceptually wrong, maybe it's just a matter of name. Will one day these people can not be suppliers or have other roles? It will be weird. But that's not the problem.
Do you have to decide, either to inherit or to compose? They are essentially antagonistic. A% of% is a NotaFiscal
? As? I can not imagine how this is possible, so inheritance seems discarded. The composition seems appropriate. But it has problems. I can not imagine why a customer should refer to an invoice object. I also find it strange that NF allows both CPF and CNPJ.
The inheritance of ClienteJuridico
in NotaFiscal
seems even more absurd (I'm not sure what this class does). My suggestion is to revise your concept of what an inheritance is. There is material on the subject here on the site.
And I notice other problems in the model, but they are details that are not the focus of the question.
Note that the use of the term attribute is correct because this is UML, but when referencing the language this is called field .