{"action":"opened","issue":{"url":"https://api.github.com/repos/appium/java-client/issues/242","labels_url":"https://api.github.com/repos/appium/java-client/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/appium/java-client/issues/242/comments","events_url":"https://api.github.com/repos/appium/java-client/issues/242/events","html_url":"https://github.com/appium/java-client/issues/242","id":105852833,"number":242,"title":"[Enhancement] Spring configuration, beans and aspects vs EventFiringWebdriver ","user":{"login":"TikhomirovSergey","id":4927589,"avatar_url":"https://avatars.githubusercontent.com/u/4927589?v=3","gravatar_id":"","url":"https://api.github.com/users/TikhomirovSergey","html_url":"https://github.com/TikhomirovSergey","followers_url":"https://api.github.com/users/TikhomirovSergey/followers","following_url":"https://api.github.com/users/TikhomirovSergey/following{/other_user}","gists_url":"https://api.github.com/users/TikhomirovSergey/gists{/gist_id}","starred_url":"https://api.github.com/users/TikhomirovSergey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TikhomirovSergey/subscriptions","organizations_url":"https://api.github.com/users/TikhomirovSergey/orgs","repos_url":"https://api.github.com/users/TikhomirovSergey/repos","events_url":"https://api.github.com/users/TikhomirovSergey/events{/privacy}","received_events_url":"https://api.github.com/users/TikhomirovSergey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-10T17:00:53Z","updated_at":"2015-09-10T17:00:53Z","closed_at":null,"body":"The Selenium project has an interesting solution,\r\nEventFiringWebDriver:\r\n- http://www.seleniummonster.com/eventfiringwebdriver-and-event-listeners-in-selenium/\r\n- http://www.abodeqa.com/2014/06/08/event-listeners-in-selenium-webdriver/\r\n- and lots of staff that Google can find\r\n\r\n## Everything is cool but I think there disadvantages for Appium users:\r\n\r\n- this implementation restricts the using of mobile-specific functions till \r\n\r\n```java\r\nAppiumDriver d = (AppiumDriver) eventFiringWebDriver.getWrappedDriver();\r\n```\r\n\r\nThe same is true for elements\r\n\r\n```java\r\nMobileElement e = (MobileElement) ((WrapsElement) element).getWrappedDriver();\r\n```\r\n\r\n- almost all interfaces which are nested in WebDriver has protected/private implementations here. So an end user has to duplicate the present code when there is need to extend it\r\n\r\nWhat is supposed to be designed:\r\n\r\n- it is supposed that the WebDriverEventListener interface will be reused. Also it would be cool if there were interfaces whose implementations allow to listen to (optionally) events of alerts, windows, contexts and so on.\r\n\r\n-  To design a solution which has linear architecture. It would be cool to use Spring & AspectJ here.\r\nhttp://www.mkyong.com/spring3/spring-aop-aspectj-annotation-example/\r\n\r\n"}}