• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business Interface Pattern

 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one explain me what is the advantage of using this "Business Interface" pattern ?.. Thanks for your help
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It abstracts away implementation details of business logic, allowing both easier testing of things that use the interfaces, and reuse of business logic in arbitrary ways.
 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the following code.

//My remote component interface.
public interface Test extends ILibrary,javax.ejb.EJBObject {
//no method definition here.
}



//my business interface
public interface ILibrary {

public String getName()throws RemoteException;
}


public class LibraryDelegate implements ILibrary {
ILibrary ilib=null;
LibraryDelegate(){
//lookup the ejb and get the reference to the ILibrary Interface.
}

public String getName() throws DesignException {
String s=null;
try {
s= ilib.getName();
} catch (RemoteException e) {
throw new DesignException(e.getMessage());
}

return s;
}

}

The getName() method in the above delegate class give me compilation error saying "Exception DesignExcpetion is not compatible with the throws clause in ILibrary.getName() method". Am i doing something thing wrong ? Thanks for your help.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes--you're trying to change the signature of an interface's methods.

Please start new topics for new questions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic