Help in restructuring a project
Posted
by
mrblah
on Stack Overflow
See other posts from Stack Overflow
or by mrblah
Published on 2010-01-12T23:15:42Z
Indexed on
2010/12/30
18:54 UTC
Read the original article
Hit count: 120
asp.net-mvc
|oop
I have a commerce application, asp.net mvc.
I want it to be extensible in the sense others can create other payment providers, as long as they adhere to the interfaces.
/blah.core
/blah.web
/blah.Authorize.net (Implementation of a payment provider using interfaces Ipaymentconfig and paymentdata class)
Now the problem is this:
/blah.core
- PaymentData
/blah.core.interfaces
- IPaymentConfig
where Payment Data looks like:
using blah.core;
public class PaymentData
{
public Order Order {get;set;}
}
IPayment data contains classes from blah.core like the Order class.
Now I want to use the actual Authorize.net implementation, so when I tried to reference it in the blah.core project I got a circular dependency
error.
How could I solve this problem? Many have said to break out the interfaces into their own project, but the problem is PaymentData references entities that are found in blah.core also, so there doesn't seem to be a way around this (in my head anyhow).
How can I redesign this?
© Stack Overflow or respective owner