
Originally Posted by
constv
Personally, I don't care who supports the idea and who doesn't, really. I have my own brain. Both, King and Bauer have strongly spoken against the repository pattern - specifically, after reading the DDD book. I respect Fowler, but no one has the ultimate authority on any subject. It seems to me, Gavin and Bauer have contributed quite a bit to the software development industry - in practice, not theory - lately, so their opinion has just as much weight if not more as any theoretician's. They both, especially Bauer - from what I have seen, have presented many intelligent arguments against that pattern that in my view are very valid. I think - as they have also stated - that the pattern is based on a weird premise/assumptions, in the first place. A DAO is not just for data bases, it is for accessing ANY data sources. So, saying that repositories unlike DAOs abstract the type of data source is ridiculous... Also, I fundamentally disagree with the concept of objects being aware of their own persistence. It is just wrong. Enough of object zealotry. One should use common sense instead. I have said it before in other threads, and I am not going to get into this again in detail, but an object must only implement the kind of functionality that is essential to the definition of the object's nature. Objects must not implement business logic that may - or may not! - be applied to them, and they should not be aware of any persistence mechanism/technology used to store them. You may think differently, and that's your right.