File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Why we Use Service Facde pattern with Hibernate? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Why we Use Service Facde pattern with Hibernate?" Watch "Why we Use Service Facde pattern with Hibernate?" New topic
Author

Why we Use Service Facde pattern with Hibernate?

sunil antil
Greenhorn

Joined: Jul 23, 2009
Posts: 20
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
obj.update();
}
Interface ServiceFacde
{
public void update();
}
class ServiceFacdeImp imlplements ServiceFacade
{
persistenceService pobj = persistenceServiceImpl();// Injecting using Spring
update()
{
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?


Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why we Use Service Facde pattern with Hibernate?
 
Similar Threads
Implementing Interface
How to use two table in criterion in hibernate
reference types SCJP 1.4
This abstract method surprised me--Kathy&Bert Book
RE:Question from K&B book