开发者

Is it ok to have a reference there?

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜