What mechanisms exist to reuse a structure: Define a structure with all the fields of another structure plus some of its own.
I have structures like this:
defmodule VideoView do
defstruct name: nil, description: nil, video_link: nil, ...
end
defmodule ImagesView do
defstruct name: nil, description: nil, images: [], ...
end
defmodule Model3DView do
defstruct name: nil, description: nil, model: nil, ...
end
There are 7 of them. In my UML, they all inherit from View, which has nameand description. I would like all of them to share these common fields, especially if I decide to add or remove a common field, this can be a real pain with the current method.
source
share