tag:blogger.com,1999:blog-3924739636407907202.post869084921460645945..comments2023-10-07T05:59:41.036-03:00Comments on HunabKu: Repository or DAO?: RepositoryFabio Maulohttp://www.blogger.com/profile/13558454874302740335noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-3924739636407907202.post-21308190439940472382009-09-16T22:24:55.021-03:002009-09-16T22:24:55.021-03:00Fabio,
I agree with you that is not good to expos...Fabio,<br /><br />I agree with you that is not good to expose any implementation, as ICriteria. But write a generic query object is a complex task.<br /><br />Maybe an intermediate solution could be to have an adhoc query object. It does not resolve all scenarios, only the required by your domain problem (more close to ddd).<br /><br />For example:<br />product = productRepository.find(<br /> Fernando Claverinohttps://www.blogger.com/profile/02423979170718490562noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-62215662085249084842009-09-15T09:21:03.887-03:002009-09-15T09:21:03.887-03:00We know limitations of actual impl. of NHLQ.We know limitations of actual impl. of NHLQ.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-26713981746086033672009-09-15T05:27:29.720-03:002009-09-15T05:27:29.720-03:00Hi,
Hope you are doing very well.
Couple of days...Hi, <br />Hope you are doing very well.<br /><br />Couple of days ago I posted an article on www.codeproject.com in which I have used Nhibernate.Linq assembly. There are couple of NHibernate.Linq tests failing whilst the LinqToSql test are not. I was wondering if you could have a look to make sure that's not due to my lack of NHibernate knowledge.<br /><br />The article link is: http://Shahrokh Shirzadhttps://www.blogger.com/profile/17567285865442498779noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-49005925977156223432009-09-14T14:54:30.311-03:002009-09-14T14:54:30.311-03:00@schlachtzeuger
Most of the time I'm using HQL...@schlachtzeuger<br />Most of the time I'm using HQL with named queries.<br /><br />In my last DAO I'm using LINQ but for "easy" queries.<br /><br />In the next prj I'll use QueryOver<T> and LINQ2NH only if I can see some advantage.<br /><br />Obviously I'm using LINQ2Object a lot.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-60973821138083072022009-09-14T14:48:15.395-03:002009-09-14T14:48:15.395-03:00Fabio,
do you honestly use NHibernate.Linq and not...Fabio,<br />do you honestly use NHibernate.Linq and not hql and criteria ?Unknownhttps://www.blogger.com/profile/00106771733124659509noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-36672883918641283432009-09-14T13:32:25.246-03:002009-09-14T13:32:25.246-03:00Opinions... the salt of IT.Opinions... the salt of IT.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-11574233278126676332009-09-14T13:25:26.249-03:002009-09-14T13:25:26.249-03:00Personally? naaahhh. I'm just stealing your bl...Personally? naaahhh. I'm just stealing your blog to post another opinion.<br />Thanks!Carlos Peixhttps://www.blogger.com/profile/05194967747763915942noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-10203338956180732792009-09-14T13:18:56.312-03:002009-09-14T13:18:56.312-03:00Please Carlos, don't take it personally.
You k...Please Carlos, don't take it personally.<br />You know that each pattern has its interpretation.<br />I can't write "IMO" in each assertion in my blog and perhaps is unneeded; when I'm writing I don't have other option than write my opinions.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-70844930496173691622009-09-14T13:15:23.032-03:002009-09-14T13:15:23.032-03:00Tano,
Your suggestion was to call "my reposit...Tano,<br />Your suggestion was to call "my repositories" it Juan (or IJuan< T >) just because it does not use the query object pattern. The naming battle is just around the corner :). <br />See youCarlos Peixhttps://www.blogger.com/profile/05194967747763915942noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-83062835312399640522009-09-14T12:56:57.756-03:002009-09-14T12:56:57.756-03:00there isn't a battle I said "or" and...there isn't a battle I said "or" and not "vs".Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-47884574594207395672009-09-14T12:51:28.494-03:002009-09-14T12:51:28.494-03:00Hi Tano,
I left behind the naming battles because ...Hi Tano,<br />I left behind the naming battles because they are useless for the contenders and, mainly, for the audience :), anyway, the arguments alone are OK.<br />I call my object retrieval abstractions "Repositories" because I think that they are, conceptually, inside the DDD definition (similar to Fowler definition). I found the query object pattern difficult to implement so I feltCarlos Peixhttps://www.blogger.com/profile/05194967747763915942noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-67266591118684578672009-09-13T18:11:55.878-03:002009-09-13T18:11:55.878-03:00The DAO will be matter of another post.The DAO will be matter of another post.Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-13761730597451196692009-09-13T18:09:45.054-03:002009-09-13T18:09:45.054-03:00I think you're right, but I just want to add t...I think you're right, but I just want to add that the use of QueryObject pattern is not required when using DAO. So the interfaces IProductRepository and ICustomerRepository are perfect examples of dao interfaces.<br />You can encapsulate there an HQL in the FindByPrice for instance.<br />So, if I'm correct I will use the Repository pattern (or Dao with QueryPatter) when I need a lot of Anonymousnoreply@blogger.com