Short answer,: it is the preferred way, yes.
Longer answer:
For unpublish you can only use the
ITransportHandler
.For publish you can use both the
RenderedItem.AddInstruction
andITransportHandler
, but it's better to use theAddInstruction
because it's an API call and not direct XML manipulation. Note that you can use theRenderedItem.AddInstruction
from two places: Templating, or from a Custom Renderer. Again itIt depends on your needs.
PS. Some shameless self promoting, but feel free to see my talk atfrom this year's TDS. It's related to your question.