Adding a portal method the right way

Thomas Lotze via Plone Community wrote at 2022-7-24 20:55 +0000:

...
During that call, the name of the select variable is being looked up by hasattr on the property manager, in that case the groupdata tool. The skin script would have been found by virtue of both being made accessible to attribute lookup on the portal, and acquisition for retrieving it from the portal while looking it up on the tool. I think having to provide it in the context of the tool now would be a nice case of doing things explicitly, but having to monkey-patch it there feels wrong.

The PropertyManager is old (far predating the invention of views).
I think it should get modernized and support views as well as attributes
for "select variables".

Another case a simple view doesn't fit as a drop-in replacement for a skin script is templates in the context of some portal content that try to look up the method on their context rather than the portal. With skin scripts this used to work by acquisition as mentioned, but views aren't subject to acquisition. I think this is a good thing, but what's a good way to have them available everywhere then?

You register them for * (which means any interface).