How to solve the violations of the Law of Demeter?

后端 未结 10 1250
一个人的身影
一个人的身影 2021-01-29 22:23

A colleague and I designed a system for our customer, and in our opinion we created a nice clean design. But I\'m having problems with some coupling we\'ve introduced. I could t

10条回答
  •  -上瘾入骨i
    2021-01-29 23:00

    For the BLL my idea was to add a property on Medicine like this:

    public Boolean IsSoluble
    {
        get { return AdministrationRoute.Soluble; } 
    }
    

    Which is what I think is described in the articles about Law of Demeter. But how much will this clutter the class?

提交回复
热议问题