So, what is the purpose for existence of both IIdentity
and IPrincipal
, and not some IIdentityMergedWithPrincipal
? When is it not enough to implement both in same class?
Also, to understand purpose, I'd like to know where this concept comes from:
- It is originated in .Net
- There is concept of Identity/Principal as design pattern, which
System.Security.Principal
implemented in those interfaces - It is originated somewhere else and supported for compatibility
Therefore, does UserPrincipal
from System.DirectoryServices
act similarly to IPrincipal
but not implement it by accident or by intention?
P.S. I'm looking for reasoning behind idea, not benefits/controversies comparison, so please try not to start opinion-based discussion
Principal
classes have absolutely nothing to do with theIIdentity
andIPrincipal
in the core .NET framework. Those are totally independent and not related in any way, shape or form (other than the naming...) – PitfallIPrincipal
andIIdentity
if you really wanted to.public class MyIdentityMergedWithPrincipal : IPrincipal, IIdentity
. If the interfaces were rolled into one on the other hand, you wouldn't be able to separate them like you can (and probably should) now. The separate interfaces are for separate concerns. – Palfrey