Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What to choose, daoFactory or a SpringUtil from ZK?

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I'm using Spting along with ZK for Presentation layer. I have got a lot of DAOs, 44 to be precise to deal with.

My question is whether to use the daofactory patter as more or less all the Spring developers use or to go with a utility class called SpringUtil provided by ZK. ZK integrates with Spring and provides this class.

You can get any bean from this class in this form



So, basically it is a design issue that I must deal with.

Thanks!!!
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I was wondering what is left other than daoFactory pattern if you were not using ZK ?

Why not just inject the dao's themselves(which are gonna be used) in the classes rather than first injecting all the daos in the daofactory and injecting daofactory in the required class?
 
Amila Domingo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Girish Vasmatkar wrote:Okay, I was wondering what is left other than daoFactory pattern if you were not using ZK ?

Why not just inject the dao's themselves(which are gonna be used) in the classes rather than first injecting all the daos in the daofactory and injecting daofactory in the required class?


Hi All,

i have a similar problem (whether to inject daos to required classes or use a dao factory). i have two questions,

1. isn't injecting daos add unnecessary code (setters)
2. what is the main advantage we get from using dao factory pattern with spring ioc (other than not having reference variables for daos and setters)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic