• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why we Use Service Facde pattern with Hibernate?  RSS feed

sunil antil
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
It is very much help full, if any one help me out. I have to developed a web application using struts 2(MVC),Spring 3 and Hibernate3. Spring Depandency Injection,tranjation mgt features are used is used to connect the Hibernate. In short i use the below desgin pattern:-

Below are the class and interface I will used?
class MyAction
// Action class, It will use the
ServiceFacde obj = new ServiceFacdeImp();// injected using DI of spring
Interface ServiceFacde
public void update();
class ServiceFacdeImp imlplements ServiceFacade
persistenceService pobj = persistenceServiceImpl();// Injecting using Spring
pobj .m1();
pobj .m2();
pobj .m3();
I used ServiceFacde interface so that spring transaction can be implementen using the ServiceFacde update method not on m1(),m2(), methods of persistenceService.
Now I want to ask two question?

question 1 Is there any another benfit of using ServiceFacde interface ?
question 2 What is the short coming of this pattern?please suggest me if any?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!