Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interfaces.. Finally. Good Practice of Location.
Message
From
19/01/2010 11:46:35
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444753
Message ID:
01444778
Views:
52
>Just one more little thing to clarify on the topic of Interfaces. I know now that I need to keep them in a separate project. And then reference the assembly of this project in those classes where the interfaces are used.
>
>So I will create a project MyInterfaces in the MyCompanyFramework Solution Folder.
>
>But my question is, is it a good practice to create a separate project for Interfaces of different layers of the application? E.g. UIFormsInterfaces, BIZInterfaces, DALInterfaces. Or simply keep all interfaces in one project?
>
>Again, thank you for any suggestions.

My 10c:

Most of the time you can (and probably should) define the interface in the same assembly as the classes that implement it. If you have a situation where you cannot do this then it implies that you somewhere have two assemblies that have a dependency on each other. In 'layered' architecture that's not ideal.

Where you *do* need seperate assemblies for interfaces then the decision on how these will be divided up will again depend on the applcation. If, for the sake of argument, you have a couple of assemblies that might be required to work together in another solution then placing interfaces that they (and they alone) depend on in a single soluton wide assembly would not be a good idea. If that's not the case the I don't see much wrong with a global 'inftrastructure' assembly.

Bottom line is that I don't think there is any consensus on best practice - it will depend on your environment.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform