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 6924899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:43:16+00:00 2026-05-27T10:43:16+00:00

I have a solution that has an MVC3 web front end. I have a

  • 0

I have a solution that has an MVC3 web front end. I have a separate assembly for view models. I have a Services assembly that contains all domain objects and business functionality and business validation. My Service also provides all view models to my web site. So the website is aware of the Service and Model assemblies. The Service is aware of the Models assembly only, and the Model assembly isn’t aware of either.

So I have a case where I need the Service to validate and process a Cart model. The items in the cart implement an interface, that I would like defined in the Service assembly. My problem is that in order for my Cart Model to use this interface, it needs to know about the Service assembly. If I define the interface in my Models assembly, I’ve now coupled these two assemblies together in a way I don’t want.

So I decided I could decouple these by adding another assembly that contains the interface, and each would reference it. So, now they would both be tightly coupled to this assembly, but they are not coupled directly too each other.

Is this ‘Interface only’ assembly a viable solution or should I be doing things differently?

  • 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-27T10:43:17+00:00Added an answer on May 27, 2026 at 10:43 am

    You can either put the Cart’s interface in the Model assembly (where the Service assembly could also see it), or you could put it in a 4th, “interface only” assembly. If you go with the latter, you might want to consider making your MVC project and service project only reference the new assembly, since that would have the added benefit of reducing coupling to the model implementations in the model assembly.

    EDIT: I should mention that removing the dependency on the Model assembly and only referencing an interface-only assembly would require using an IoC container or something similar to load the concrete implementation (defined in the Model assembly)

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

Sidebar

Related Questions

I have a solution that contains two projects. One project is an ASP.NET Web
I have inherited a reasonable sized ASP.net solution that has no automated tests. The
I have a solution that contains a good deal of projects, I would like
Currently I have solution A that contains a domain layer base and solution B
i have the WCF web service within my solution. service has interface which implemeted
I have a solution that has a plain old asp.net website and a winforms
I have a solution that has only 1 project, with about 30 class files.
I have this Visual Studio solution that includes a project that has a template
I'm working on a asp.net mvc3 solution that has 3 projects Data, Service, and
I have a solution that has some EF objects. I want to pass them

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.