Five Considerations for Software Architects
Recorded at:
Factory and Junkyard are not the same.
by
Ashwanth Fernando
Re: Factory and Junkyard are not the same.
by
Kevlin Henney
There is a subtle shift in metaphor from ownership (manufacture, own and discard) to one of borrowing (borrow, use and return), a more resource-centred view of object lifecycles, both low-level resources and domain objects that have structured lifecycles with well-defined retirement/completion events.
When it comes to addressing where the disposal role should go, there are of course two existing locations that could serve: the product and the producer. The one discussed in the talk is that of the producer, i.e., a factory disposal method. The alternative that you mention, i.e., self-disposal method, is not discussed in the talk, but is an equally valid consideration (just not the one explored in the talk). My VikingPLoP 2003 paper, "Factory and Disposal Methods" (is.gd/5gKf0) discusses both variants.
Returning to the real world we may also consider that the responsibility for disposing of the Accord should lie with the original manufacturer. Just because it doesn't at the moment, does not mean that the status quo represents the most appropriate solution!
I hope that answers your question.




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think