Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 281209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:11:02+00:00 2026-05-12T05:11:02+00:00

I am just reading Agile Principles, Patterns and Practices in C# by R. Martin

  • 0

I am just reading Agile Principles, Patterns and Practices in C# by R. Martin and M. Martin and they suggest in their book, to keep all your interfaces in a separate project, eg. Interfaces.

As an example, if I have a Gui project, that contains all my custom Gui classes, I will keep their interfaces in the Interfaces project. Specifically I had a CustomButton class in Gui, I would keep the ICustomButton interface in Interfaces.

The advantage is, that any class that needs an ICustomButton does not need a reference to Gui itself, but only to the much lighter weight Interfaces project.

Also, should a class in the Gui project change and thus cause it to be rebuilt, only the projects directly referring to the CustomButton would need recompilation, whereas the ones referring to the ICustomButton may remain untouched.

I understand that concept, but see a problem:

Lets say I have this interface:

public interface ICustomButton
{
    void Animate(AnimatorStrategy strategy);
}

As you can see, it refers to AnimatorStrategy, which is a concrete class and therefore would sit in a different project, lets call it Animation.
Now the interface project needs to refer to Animation. On the other hand, if Animation uses an interface defined in Interfaces, it needs to refer to it.

Cyclic dependency – “Here we come”.

The only solution for this problem, that I see, is, that all methods defined in the interfaces take inputs that are themselves interfaces. Trying to implement this, will most likely have a domino effect though and quickly require an interface to be implemented even for the most basic classes.

I don’t know if I would like to deal with this overhead in development.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:11:02+00:00Added an answer on May 12, 2026 at 5:11 am

    Beware of always, ever, and never – especially near all, none, or every.

    Should you always put all of you interfaces in a separate assembly? No – not necessarily.

    Should you put interfaces that you expect external consumers of your code to implement – possibly. I would put interfaces into an external assembly if you expect multiple assemblies in your project to rely on them – this can help break coupling dependencies. I’ve also used this practice to solve circular referencing issues, where assemblies need to be aware of interfaces in one another.

    I don’t put interfaces that are only used internally in a project in a separate assembly. I also don’t promote interfaces into their own assembly when my projects are relatively small – or the interfaces are not intended to be used without the assembly that depends on them.

    As for the example you presented – I would suggest that you consider NOT referencing classes in your system from interfaces. Whenever possible, I try to have interfaces only reference other interfaces – this keeps things relatively decoupled. You can’t always achieve this – and so when you have these types of interfaces – you have to keep them with the assembly they depend on.

    If you do decide to put interfaces into a separate assembly – you shouldn’t necessarily put them all into a single assembly. You may want to break them out by their intended usage – this way consumers can pull in just the interfaces that are relevant to a particular domain of functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just reading up on how linux works in my OS-book when I
I was just reading how FaceBook designed their chat system, and it reads: and
I was just reading http://api.jquery.com/event.stopPropagation/ Since the .live() method handles events once they have
I've been reading about the various forms and aspects of agile development, but all
I am currently reading a book, and learning ruby on rails. (Agile Web Development
I was just reading this question How do they do this - Mobile Site
Just reading in a C++ book that you can literally drop assembler into C++
I'm just reading up on SOA and the service registry / UDDI get mentioned
I was just reading this thread and it occurred to me that there is
I was just reading up a lecture which breifly went over Container Interface. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.