| Author |
Master DAO or many DAOs ?
|
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
Hi. In my application, I have domain objects like : Book, Author, Publisher (I'm using Hibernate).... I created interfaces like BookDAO, AuthorDAO and then implement them using HibernateDaoSupport. But while I'm coding my DAO's, a question came into my mind : Is it good to many DAOs (like my case) or to create a master DAO called for example : BookStoreDAO ? What is the right approach here ? Thanks folks
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26193
|
|
John, There is no right or wrong here. It's a matter of personal preference.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Jaime M. Tovar
Ranch Hand
Joined: Mar 28, 2005
Posts: 133
|
|
I recomend many daos if you are planning to reuse your code. You can just take the things you need and leave everything else out of your new project. It is also easier to work when you are doing maintenance because you know exactly in which dao you need to do the corrections. Well just my opinion.
|
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
|
 |
Mr. C Lamont Gilbert
Ranch Hand
Joined: Oct 05, 2001
Posts: 1170
|
|
I have both many daos and then a master dao that most others are obtained from. but that master dao is not really a dao then since its not really about data access but dao access
|
 |
Pavel Kubal
Ranch Hand
Joined: Mar 13, 2004
Posts: 356
|
|
I would like to add, that there's no wrong and right. There is better and worse (or equal :-) ). And it really depens on what is the target scope. But from you description, I incline to many DAOs.
|
 |
 |
|
|
subject: Master DAO or many DAOs ?
|
|
|