Ayende @ Rahien

Refunds available at head office

What hid under the bed...

public class ARValidatingAuthorizationRepository<TIEntityType, TIUsersGroup, TIEntitiesGroup, TIOperation, TIEntityReference, TIPermission>     
  :  RhinoAuthorizationRepository< TIEntityType, TIUsersGroup, TIEntitiesGroup, TIOperation, TIEntityReference, TIPermission> 
      where TIEntityType : class, IEntityType, new()
      where TIUsersGroup : class, IUsersGroup, new()
      where TIEntitiesGroup : class, IEntitiesGroup, new()
      where TIOperation : class, IOperation, new()
      where TIEntityReference : class, IEntityReference, new()
      where TIPermission : class, IPermission, new()

Comments

Chad Myers
06/29/2008 06:39 AM by
Chad Myers

We might have to revoke your Generics License for that one.

Jason Olson
06/29/2008 07:01 AM by
Jason Olson

Holy Generics, Batman!!!! :P

Frans Bouma
06/29/2008 09:43 AM by
Frans Bouma

whoa :D

What's even more funny, all types have an interface, so the method also could have just used the interfaces and it would still be a generic method

Rytmis
06/29/2008 02:42 PM by
Rytmis

Frans: Except that interfaces don't allow constructor definitions, but the generics constraints can demand that the type have a zero-argument public ctor.

Vladan Strigo
06/29/2008 03:53 PM by
Vladan Strigo

Maybe a new smell should be named... "Generics explosion" :)

Vladan

l0t3k
06/29/2008 07:58 PM by
l0t3k

Ya know, thats exactly the reason i never got into the C++ STL, but strangely i have less of a problem with this...

Jeremy D. Miller
06/30/2008 12:28 PM by
Jeremy D. Miller

I don't want to play oneupsmanship here, but as soon as I finished this code I knew I needed to post this here:

public abstract class CrudController<DomainModel, ToViewModel, FromViewModel, THIS>

    where DomainModel : DomainEntity, new()

    where ToViewModel : ViewInputModel<THIS>, new()

    where FromViewModel : ViewModel

    where THIS : CrudController<DomainModel, ToViewModel, FromViewModel, THIS> 
Joe Reddy
06/30/2008 08:56 PM by
Joe Reddy

Good grief.

You do this kind of stuff on purpose?

Comments have been closed on this topic.