Invoker  

There will be as many invokers as there are are components. Components can be textboxes, radio buttons, and so on. Each individual invoker will create a command object inside it. There will be customized methods inside each invoker, but inside each customized method, the execute method from the ACommand abstract class will be called. The individual invoker will call the overloaded execute methods from the ACommand abstract class.

The following code shows the BrowserInvoker class:

public class BrowserInvoker {
private ACommand aCommand = null;

public BrowserInvoker(ACommand command) {
this.aCommand = command;
}

public WebDriver open(List<String> browserName) {
WebDriver driver = aCommand.execute(browserName);
return driver;
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.217.228