I'm struggling to understand how to refactor my site to cleaner code by letting my Domain Entities have their behavior.
I hope i have managed to describe my problem in this diagram:
A is my current design of Web application project while B is my target design.
I'm trying to insert all logic from my current BL to my Entities so that a code line like:
var customer = new CustomerLogic().GetCustomer(id);
Would become:
var customer = new Customer(id);
Or,
var customer = Customer.Get(id);
It's even more obvious when i see a polymorphic situation.
The problem is that while in my current design (A) Entities are just being used so all projects have a reference to it, with the future design (B) Entities will have to have a reference to a lower layer.
But Since i also want my DAL to deliver my Entities back to the calling client i get to have a circular reference.
My current design makes my code more procedural than Object Oriented and i want to change that.
So, how can i solve this circular reference while maintaining a DDD?