views:

32

answers:

1

Hello

I am building a new project with Castle ActiveRecord and have a little technical question.

I build my projects workspace and added 5 projects.

  • ViewModel for interfaces and application logic
  • Model for the basic model classes
  • Test for unit testing
  • Client for my WPF client
  • data for my datasource

Then i added some references to Castle.ActiveRecord in Model, ViewModel and data project. I think i should not have so many referrences to ActiveRecord in my project. In general in the data project but the model class has its decorators to get the AR to work. When there is no reference to AR in the ModelView it gets errors when i define my interfaces to the dao that there is no reference to AR in my ModelView.

Its mainly a design question not a functional thing. Is does create some dependencies that i would not have when i later decide to use another datasource.

Is it ok to add references to AR everywhere or how can i solve this on another way?

Thanks Boris

+1  A: 

ActiveRecord is supposed to be more invasive than NHibernate since it doesn't use pure POCOs. If you really want to avoid those references use NHibernate instead.

Anyway, IMHO you have way too many projects there. And application logic in the ViewModel project doesn't sound right. See this article for some rationale to keep the amount of projects down.

Mauricio Scheffer
Thanks for your answer and the helpful article.
Booser
I think i do it so that i take the complete core **Data, Model, ViewModel** to one Assembly, client in a seperate assembly because it should be so flexible to have a web interface too and finally an assembly with the unit tests.
Booser

related questions