I have a Web scoped Feature which provisions a number of Content Types, List Templates & Instances, Custom Actions etc that enables a discrete set of functionality. I also have a number of WebParts which use the Content Types, Lists etc provisioned by this Feature to provide reusable functionality. In SP2010 WebParts can only be deployed through Site scoped Features as they must go into the appropriate gallery so therefore I can't stop them being available even in a Web which doesn't have my Feature activated.
My question then is how to manage the dependency on the Web scoped feature being activated inside the code for the WebParts? Is there a recognised best practice approach to this? Should I just handle exceptions so that the WebPart doesn't 'break' the page it is added to if the required Feature isn't activated? Or is there a neat way to check the dependency at the time the WebPart is added to the page, alert the user and stop it being added if the Feature isn't activated?