Skip to content

Refactor model as an argument to hydrate class methods #52

@Midnighter

Description

@Midnighter

Yeah - I was trying to establish a consistent pattern across SoftwareSystem, Container, Component and DeploymentNode. A couple of alternative approaches:

  • In Model, when a SoftwareSystem or DeploymentNode is added then it Model could explicitly add all the children. This would be made easier if we added a children property to ModelItem which by default returned an empty list but could be overridden by subtypes (e.g. SoftwareSystem would return its containers, etc.).
  • In SoftwareSystem, etc. we override set_model (from ModelRefMixin) to also set the model in its containers, etc.

I'm leaning toward the first approach (including the generic children) as it feels less fragile.

Originally posted by @yt-ms in #41 (comment)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions