It is exactly your proposal (first one to match wins), with uglier syntax :D Would it even fulfill your requirements? For example "What if I don't have control over that module?" This one would make it impossible.