Repository<T> for NHibernate

31 views
Skip to first unread message

Selcuk OZDOGAN

unread,
Nov 2, 2009, 3:57:51 AM11/2/09
to altdotnetturkiye
Merhaba arkadaşlar,

NHibernate kullanacağım uygulamalarda kullanabileceğim bir
Repository<T> implementasyonu
önerebilir misiniz? Kendim de basitçe Rep. pattern implement eden bir
repository<t> sınıfı yazdım,
ancak ucu açık bir konu biraz, uygulama safhasında yaşayabileceğim
muhtemel eksikler için, daha önce tecrübe edilmiş bir rep pattern kodu
varsa görmek isterim.

Saygılar.

Murat HAKSAL

unread,
Nov 2, 2009, 4:00:08 AM11/2/09
to altdotne...@googlegroups.com
Ayende nin yazdığı Rhino.Commons öneririm.
https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/branches/net-2.0/rhino-commons



02 Kasım 2009 10:57 tarihinde Selcuk OZDOGAN <selcuk....@gmail.com> yazdı:

--

You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To post to this group, send email to altdotne...@googlegroups.com.
To unsubscribe from this group, send email to altdotnetturki...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/altdotnetturkiye?hl=en.



Sidar Ok

unread,
Nov 2, 2009, 5:00:18 AM11/2/09
to altdotne...@googlegroups.com
+1. 

Fakat sorarlar, neden Repository<T> diye ? 

Ben her aggregate root icin bir custom repository den yanayim. Customer icin insert yoksa neden insert u implement edeyim sirf base repo istiyor diye ?


2009/11/2 Murat HAKSAL <murat....@gmail.com>

Tolga Yıkılmaz

unread,
Nov 2, 2009, 5:53:52 AM11/2/09
to altdotne...@googlegroups.com
+1

02 Kasım 2009 12:00 tarihinde Sidar Ok <sid...@gmail.com> yazdı:

Pattaya

unread,
Nov 2, 2009, 6:17:45 AM11/2/09
to altdotne...@googlegroups.com
IPersistableRepository<T>
IQueryableRepository<T>
gibi birseyler daha $IK bir goruntu saglar.

2009/11/2 Tolga Yıkılmaz <tolga.y...@gmail.com>:

Selcuk OZDOGAN

unread,
Nov 2, 2009, 9:38:12 AM11/2/09
to altdotnetturkiye
Selam, bahsettiğinizi örnekleyebilir misiniz?

On Nov 2, 12:00 pm, Sidar Ok <sida...@gmail.com> wrote:
> +1.
>
> Fakat sorarlar, neden Repository<T> diye ?
>
> Ben her aggregate root icin bir custom repository den yanayim. Customer icin
> insert yoksa neden insert u implement edeyim sirf base repo istiyor diye ?
>
> 2009/11/2 Murat HAKSAL <murat.hak...@gmail.com>
>
>
>
> > Ayende nin yazdığı Rhino.Commons öneririm.
>
> >https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/branches/...
>
> > 02 Kasım 2009 10:57 tarihinde Selcuk OZDOGAN <selcuk.ozdo...@gmail.com>yazdı:
>
> > Merhaba arkadaşlar,
>
> >> NHibernate kullanacağım uygulamalarda kullanabileceğim bir
> >> Repository<T> implementasyonu
> >> önerebilir misiniz? Kendim de basitçe Rep. pattern implement eden bir
> >> repository<t> sınıfı yazdım,
> >> ancak ucu açık bir konu biraz, uygulama safhasında yaşayabileceğim
> >> muhtemel eksikler için, daha önce tecrübe edilmiş bir rep pattern kodu
> >> varsa görmek isterim.
>
> >> Saygılar.
>
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "altdotnetturkiye" group.
> >> To post to this group, send email to altdotne...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> altdotnetturki...@googlegroups.com<altdotnetturkiye%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/altdotnetturkiye?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "altdotnetturkiye" group.
> > To post to this group, send email to altdotne...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > altdotnetturki...@googlegroups.com<altdotnetturkiye%2Bunsu...@googlegroups.com>
> > .

Pattaya

unread,
Nov 2, 2009, 11:02:04 AM11/2/09
to altdotne...@googlegroups.com
Aslinda bir cesit CQS havasi yaratilmis oluyor.

Sadece sorgulama icin:
interface IQueryRep<T>
{
IEnumerable<T> GetAll ();
T GetById ();
Get ... Get... get...
}

Degisiklik icin:
interface IPersistRep<T>
{
void Save (T t);
void Delete (T t);
}

Kullanirken de ihtiyacim hem yazma hem okuma ise IPersist ve IQuery
kullanirim. Sadece rapor sorgulayan bir depo icin de IQuery
kullanirim.


2009/11/2 Selcuk OZDOGAN <selcuk....@gmail.com>:
> To unsubscribe from this group, send email to altdotnetturki...@googlegroups.com.

Selcuk OZDOGAN

unread,
Nov 3, 2009, 3:12:35 AM11/3/09
to altdotnetturkiye
Anladım. Evet gayet güzel bir çözümmüş.
Peki bir sorum daha olacak. Birden fazla tablonun joinlenmesi
durumunda repositorylerde nasil bir yol izlemek gerekir?

On Nov 2, 6:02 pm, Pattaya <cefer...@gmail.com> wrote:
> Aslinda bir cesit CQS havasi yaratilmis oluyor.
>
> Sadece sorgulama icin:
> interface IQueryRep<T>
> {
>      IEnumerable<T> GetAll ();
>      T GetById ();
>      Get ... Get... get...
>
> }
>
> Degisiklik icin:
> interface IPersistRep<T>
> {
>       void Save (T t);
>       void Delete (T t);
>
> }
>
> Kullanirken de ihtiyacim hem yazma hem okuma ise IPersist ve IQuery
> kullanirim. Sadece rapor sorgulayan bir depo icin de IQuery
> kullanirim.
>
> 2009/11/2 Selcuk OZDOGAN <selcuk.ozdo...@gmail.com>:

Pattaya

unread,
Nov 3, 2009, 3:29:27 AM11/3/09
to altdotne...@googlegroups.com
Sordugun Data Access'inle ilgili olan kismi. Dal'da cozmen gerekir.

2009/11/3 Selcuk OZDOGAN <selcuk....@gmail.com>:
Message has been deleted

Gökhan Ercan

unread,
Dec 23, 2009, 6:08:54 PM12/23/09
to altdotnetturkiye
Örnek için aşağıdaki kaynaklar incelenebilir;

http://www.amazon.com/NET-Domain-Driven-Design-Solution-Programmer/dp/0470147563/ref=sr_1_4?ie=UTF8&s=books&qid=1261609395&sr=8-4
http://dddpds.codeplex.com/

> > >> altdotnetturki...@googlegroups.com<altdotnetturkiye%2Bunsubscrib e...@googlegroups.com>


> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/altdotnetturkiye?hl=en.
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "altdotnetturkiye" group.
> > > To post to this group, send email to altdotne...@googlegroups.com.
> > > To unsubscribe from this group, send email to

> > > altdotnetturki...@googlegroups.com<altdotnetturkiye%2Bunsubscrib e...@googlegroups.com>

ilgiz SEBER

unread,
Dec 24, 2009, 2:11:39 AM12/24/09
to altdotne...@googlegroups.com
Repository<T> implementasyonuyla ilgili başka bir örneğe de şu svn linkinden ulaşabilirsin:


Ancak göndermiş olduğum svn linkindeki projede Base Repo uygulaması var. Bunun yerine Sidar'ın daha önce bahsetmiş olduğu Custom Repo kavramı daha tercih edilir geliyor bana da. ;)

2009/11/2 Selcuk OZDOGAN <selcuk....@gmail.com>
--

You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To post to this group, send email to altdotne...@googlegroups.com.
To unsubscribe from this group, send email to altdotnetturki...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/altdotnetturkiye?hl=en.





--
İlgiz SEBER
Software Developer

Karash Software & Security Technologies
Mobile: +90 533 2819232
Phone: +90 216 3262501
Fax: +90 216 3261607

Selcuk OZDOGAN

unread,
Dec 24, 2009, 2:19:23 AM12/24/09
to altdotne...@googlegroups.com
Hemen inceliyorum arkadaşlar, teşekkür edeirm.

24 Aralık 2009 09:11 tarihinde ilgiz SEBER <ise...@gmail.com> yazdı:
Reply all
Reply to author
Forward
0 new messages