<p>I have seen two ways of implementing DAO-DVO design.</p>

<p>1) DVO are objects and DAOs are instantiated using factories i.e DAOs are also objects
2) DVOs are again objects but in this case, DAOs are classes which contain only static methods which accept DVOs to perform tasks.</p>

<p>I was wondering which way is better and more scalable.</p>

[{'answer_id': 24630, 'author': 'Michael Neale', 'author_id': 699, 'author_profile': 'https://Stackoverflow.com/users/699', 'pm_score': 0, 'selected': False, 'text': '<p>I would strongly recommend not using that many layers unless they are really layered physically. eg if you have something like a rich client where you need to send detached objects to update the GUI, otherwise, its a world of pain.</p>\n'}, {'answer_id': 24647, 'author': 'bpapa', 'author_id': 543, 'author_profile': 'https://Stackoverflow.com/users/543', 'pm_score': 1, 'selected': False, 'text': "<p>Try the Spring Framework. DAOs are initialized via Dependency Injection and are just plain 'ole Java objects.</p>\n\n<p>Then, the methods on the DAO should just use Domain Objects that are used at all layers of the Application.</p>\n"}, {'answer_id': 397595, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>How to download DAO Factory to create Database Connectivity?</p>\n'}, {'answer_id': 397633, 'author': 'Ole', 'author_id': 49540, 'author_profile': 'https://Stackoverflow.com/users/49540', 'pm_score': 1, 'selected': False, 'text': '<p>With regards to testability, I\'d advise against the second approach. Static methods prevent you from adjusting the class\'s behaviour by overriding collaborators with mocks and such. As Miško Hevery puts it: "<a href="http://misko.hevery.com/2008/12/15/static-methods-are-death-to-testability/" rel="nofollow noreferrer">Static Methods are Death to Testability</a>".</p>\n'}]
['https://Stackoverflow.com/questions/24623', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']