Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Business Interface Pattern  RSS feed

 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The Business Interface Pattern as specified at www.theserverside.com has the following disadvantage.

There is one dangerous side effect of using the Business Interface pattern. For mehods whose return values are the remote/local interface of the bean itself, implementing the business interface allows the bean developer to return this without any compile-time problems being detected. This is possible because both the bean class and the remote/local interface implement the business interface.

I am not able to understand what is being meant
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the quote means that you can return an interface class instead of an implementation class without compile time errors (as both the interface and its implementation contain the same methods).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!