Yeah, I understand what's going on. I just question the utility of having them 
in the first place if there is always only one implementation of them. 

That being said, one pattern for addressing this is to use the same namespaces 
in different projects. E.g., I have MyProject.Common where interfaces live and 
inside that I might define MyProject.Common/Models/IMyModel with an 
implementation in MyProject.Common.Models/MyModel.

Inside MyProject.Common I have all of my interfaces in directories and then 
separate projects for each directory. I'm not sure if this addresses your 
specific problem or not, but in this world you could have both your 
IUserRepository : IRepository<IMyModel> and IMyModel in MyProject.Common with 
implementations in separate projects. 


On Sunday, September 18, 2011 at 12:22 AM, Gitted wrote:

> The problem I was having, was that I have a seperate project for my
> interfaces.
> 
> So when it came to the interface:
> 
> public interface IUserRepository : IRepository<IUser>
> 
> I couldn't put IRepository<User> since this is my interfaces project,
> so I figured I have to create an interface for my models i.e. IUser
> 
> Make sense?
> 
> On Sep 17, 7:16 pm, Shawn Hinsey <[email protected] (http://gmail.com)> 
> wrote:
> > I don't think there is a problem with this per se, but I would question the 
> > utility of such a layering approach because it subverts the intent of an 
> > interface, which is to separate contract from implementation, because it's 
> > unlikely to come to pass that you actually have more than one 
> > implementation of your model interfaces.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Saturday, September 17, 2011 at 7:13 PM, Gitted wrote:
> > > My nhibernate entities are implement interfaces, is this wrong?
> > 
> > > I was forced to do this because I moved all interfaces to their own
> > > vs.net (http://vs.net) project.
> > 
> > > public class User : IUser
> > > {
> > > ..
> > > ..
> > > }
> > 
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Castle Project Users" group.
> > > To post to this group, send email to 
> > > [email protected] 
> > > (mailto:[email protected]).
> > > To unsubscribe from this group, send email to 
> > > [email protected] 
> > > (mailto:[email protected]).
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/castle-project-users?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To unsubscribe from this group, send email to 
> [email protected] 
> (mailto:[email protected]).
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to