We have this bean with two properties:
ContainerImage + name (final, not null) + id (null)
Then there is this method:
ContainerImage create(ContainerImage containerImage);
name and without the
id; and returns new
id populated, as result from the underlaying operation.
For me, this has bad smell; because input simply does not use the
id, so why would I pass it? Also, it does not change the incoming object, which is also fine, but someone might add the change, which I don't want.
My proposal is to have an read-only interface for
ContainerImage that does not takes the
id, that will be used for input argument, e.g.:
ContainerImageData + name
Does this make sense for you?
p.s. I am talking Java now, but the question is rather general.
create creates docker images, so it is a method that works with docker remote api, plus it may do some few things aside. But I would like to think about this question without knowing what it really does, just from the API side.