Hi there,
I'm trying to build a .Net application following a couple of considerations in the architecture:
1. There shall be User Interface Layer, Business Logic Layer and Data Access Layer
2. All the three layers shall be in separate projects
I would like to achieve the following out of this layered architecture:
1. User Interface shall request for an object to the Business Layer
2. Business Layer shall send an empty Business Object to the Data Access Layer
3. Data Access Layer shall populate the Business Object and send it back to the Business Layer
4. Business Layer shall send the populated Business Object back to the User Interface.
The problem:
I have set a reference in the Business Layer to the Data Access Layer. Now for the Data Access Layer to recognize the Business Object, I have to set a reference in the Data Access Layer to the Business Layer. This will throw a circular dependency error.
Is there a workaround for this issue which follows Object Oriented Model?
Regards,
Som.
If you want to separate the db code from the business object, you might want to look into the separated interface http://www.martinfowler.com/eaaCatalog/separatedInterface.html . It can be used to solve the circular reference problem. Another option would be to use DTOs.
Thanks for the usefull ideas and links!
I'll have a look at them.
Regards,
Som.
Copyright (c) Marimer LLC