Class with too many parameters: better design strategy?

后端 未结 13 926
醉酒成梦
醉酒成梦 2020-12-04 08:29

I am working with models of neurons. One class I am designing is a cell class which is a topological description of a neuron (several compartments connected together). It ha

13条回答
  •  北海茫月
    2020-12-04 08:46

    Looks like you could cut down the number of arguments by constructing objects such as Axon, Soma and DendriticTree outside of the LayerV constructor, and passing those objects instead.

    Some of the parameters are only used in constructing e.g. DendriticTree, others are used in other places as well, so the problem it's not as clear cut, but I would definitely try that approach.

提交回复
热议问题