English 中文(简体)
在所有解决方案项目中分享领域示范目标
原标题:Sharing Domain model objects in all solution projects

I have all the time the same situation when building my projects . I have the main Domain model (entity framework model) . I added a wcf data service project to help query this model . Now if I want to use one of the objects of the model either I have to reference the Domain model dll and this is not always good because the project maybe will be silverlight , or I can use a service reference and this maybe better choise but not clear poco object.

您是否建议最佳地实践我如何分享共同模式,因此,我可以与“国际倡议”、远程服务一起使用。

预收......

最佳回答

这可能不是一个伟大的想法。 但是,我听说过EF4得到残疾人组织的支持,因此,你可以把他们单独地交给任何人。

尤其是,银团观看wcf ria services

问题回答

贵领域的模式应该是POCO,而不是EF模型。

If you use pure POCO s, then your domain model project will not reference EF at all, it s a basic .NET class library which can be consumed by any .NET client.

要么使用POCO,要么在EF模式与客户之间创建一个框架,在其中,你可以将EF实体建设成DTO。

您按领域模式的含义是什么? 你们是否只指由EF或T4模板产生的类别? 或者,你指的是实际领域目标,即产生类别与含有实际商业方法的另一种部分类别相结合?

在前一种情况下,你只能与客户分享。 如果服务,它将在服务和客户之间造成紧密的 coup合,通常被视为一种不良做法。 但仍然有一些假设情况,即使用周转基金而不是重启,在这种情况下,共享大会是常见的情况。

在后一种情况下,点为:DO NOT SHARE域标与贵处客户。 域标及其方法供用户使用。 利用专业DTO或服务参考产生的物体。

如果你与网络服务合作,你就应当遵循简单规则:你的模式跨越实际边界。 这意味着这一模式是内部的,客户不使用。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签