• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Business Interface Pattern

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can some one explain me what is the advantage of using this "Business Interface" pattern ?.. Thanks for your help
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic