{"action":"created","issue":{"url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/4","repository_url":"https://api.github.com/repos/yihtserns/groovy-decorator","labels_url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/4/comments","events_url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/4/events","html_url":"https://github.com/yihtserns/groovy-decorator/issues/4","id":140513113,"number":4,"title":"Check if order of method decoration is intuitive","user":{"login":"yihtserns","id":3615932,"avatar_url":"https://avatars.githubusercontent.com/u/3615932?v=3","gravatar_id":"","url":"https://api.github.com/users/yihtserns","html_url":"https://github.com/yihtserns","followers_url":"https://api.github.com/users/yihtserns/followers","following_url":"https://api.github.com/users/yihtserns/following{/other_user}","gists_url":"https://api.github.com/users/yihtserns/gists{/gist_id}","starred_url":"https://api.github.com/users/yihtserns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yihtserns/subscriptions","organizations_url":"https://api.github.com/users/yihtserns/orgs","repos_url":"https://api.github.com/users/yihtserns/repos","events_url":"https://api.github.com/users/yihtserns/events{/privacy}","received_events_url":"https://api.github.com/users/yihtserns/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-13T18:24:36Z","updated_at":"2016-03-14T09:34:47Z","closed_at":null,"body":"E.g. \r\n### Example 1\r\n```groovy\r\n@Log(entry=true, exit=true)\r\n@Allow(Role.FIELD_AGENT)\r\n@CacheResult\r\nString getSecret(user, secretId) {\r\n  ...\r\n}\r\n```\r\n### Example 2\r\n```groovy\r\n@CacheResult\r\n@Log(entry=true, exit=true)\r\n@Allow(Role.FIELD_AGENT)\r\nString getSecret(user, secretId) {\r\n  ...\r\n}\r\n```\r\n### Example 3\r\n```groovy\r\n@Log(entry=true, exit=true)\r\n@CacheResult\r\n@Allow(Role.FIELD_AGENT)\r\nString getSecret(user, secretId) {\r\n  ...\r\n}\r\n```\r\n### Example 4\r\n```groovy\r\n@Allow(Role.FIELD_AGENT)\r\n@CacheResult\r\n@Log(entry=true, exit=true)\r\nString getSecret(user, secretId) {\r\n  ...\r\n}\r\n```\r\n\r\nSince CacheResult caches the result, looking at the annotations, how many times would a person think Allow (which check if user is authorized to call method) and Log will be called for each example?"},"comment":{"url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/comments/196225607","html_url":"https://github.com/yihtserns/groovy-decorator/issues/4#issuecomment-196225607","issue_url":"https://api.github.com/repos/yihtserns/groovy-decorator/issues/4","id":196225607,"user":{"login":"yihtserns","id":3615932,"avatar_url":"https://avatars.githubusercontent.com/u/3615932?v=3","gravatar_id":"","url":"https://api.github.com/users/yihtserns","html_url":"https://github.com/yihtserns","followers_url":"https://api.github.com/users/yihtserns/followers","following_url":"https://api.github.com/users/yihtserns/following{/other_user}","gists_url":"https://api.github.com/users/yihtserns/gists{/gist_id}","starred_url":"https://api.github.com/users/yihtserns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yihtserns/subscriptions","organizations_url":"https://api.github.com/users/yihtserns/orgs","repos_url":"https://api.github.com/users/yihtserns/repos","events_url":"https://api.github.com/users/yihtserns/events{/privacy}","received_events_url":"https://api.github.com/users/yihtserns/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T09:34:47Z","updated_at":"2016-03-14T09:34:47Z","body":"@ceilfors sees it this way:\r\n### Example 1\r\n```groovy\r\n@Decorator1\r\n@Decorator2\r\n@Decorator3\r\nString getSecret(user, secretId) {\r\n  ...\r\n}\r\n```\r\n1. Wrap with `Decorator1` first, then\r\n2. Wrap with `Decorator2`, then\r\n3. Wrap with `Decorator3`."}}