与其他项目(.NET)共享我的存储库(存储库模式)?

发布于 2024-07-26 01:43:40 字数 505 浏览 1 评论 0原文

我正在尝试整理我的代码,我有许多项目引用了我的服务层,即 DLL。 这意味着,当我分发一个新的服务层时,我必须上传许多通常相同的服务层。

当然,使用 ADD Reference 非常快,因为它的一个程序集与另一个程序集通信...

我想了解替代方法的优缺点..

我可以使用 Web 服务/WCF 来包装我的服务层,但这不是打败对象吗..

那么速度呢,现在我的桌面应用程序需要调用 Web 服务/ wcf 而不是访问程序集引用?

当然,我的服务层与我的数据层对话,而我的客户从不直接与数据层对话。

这是服务层的问题,这是我的业务逻辑所在,在许多应用程序之间共享。

桌面应用程序,2 x 网站,2 x wcf 项目(用作网络服务)

有关如何在不重复我的代码的情况下实现最快可能的场景的任何建议,这影响我现在正在做的事情,即

每个应用程序(桌面、网站、wcf)在相同的 DLL 并有引用(在 vs 2008 中添加引用)..

有想法吗?

i am trying to tidy up my code, i have a number of projects that have References to my Service Layer i.e the DLL. What this means is that when i distribute a new service layer i have to upload a number of service layers which are generally the same..

Of course using the ADD Reference is very fast as its one assembly talking to another...

I wanted to know the pros and cons of an alternative method..

I could use a web service/wcf to wrap my service layer but isn't this defeating the object..

And what about speed, now my desktop applications need to call to web service/wcf instead of accessing the assembly reference??

My service layer talks to my data layer of course and my clients nevere talk to the data layer directly..

Its the issue of the service layer which is where my business logic is which is shared amongst a number of apps..

Desktop app, 2 x website, 2 x wcf projects(used as web services)

Any advice on how i can achieve the fastest possibly scenerio without repeating my code which is effect what i am doing now i.e.

each app (desktop, website, wcf) have copies on the same DLL and have references (add reference in vs 2008) ..

Ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡写薰衣草的香 2024-08-02 01:43:40

我认为使用 WCF(它包含 .net 远程处理、msmq 等)会让您受益匪浅。 然后你就不必为每个程序复制一个 dll...它们可以只指向一个 WCF 服务。 这种类型的面向服务的体系结构非常适合您所描述的内容。

根据我迄今为止使用 WCF 的经验,我没有注意到任何性能影响,尤其是在内部网络上。

以下是有关 WCF 的详细概述: http://msdn.microsoft.com/en -us/library/aa480210.aspx

希望这有帮助!

I think you would benefit best by using WCF (which wraps up .net remoting, msmq, etc.). Then you wouldn't have to copy a dll with each program... they can just point to a WCF service. This type of service oriented architecture is great for what you are describing.

From my experience with WCF so far, I have not noticed any performance hits, especially on an internal network.

Here's a good overview on WCF: http://msdn.microsoft.com/en-us/library/aa480210.aspx

Hope this helps!

心病无药医 2024-08-02 01:43:40

如果您主要在单个主机上部署应用程序,则选择在 GAC 中发布中间层,为其提供适当的版本策略。

如果您在分布式环境中部署应用程序,请使用.NET 远程处理/WS/WCF。 我认为远程处理将是您场景中最快的选择。

If you deploy apps mostly on a single host, then chose publishing your middle-layer in GAC, supplying it with appropriate version policy.

If you deploy apps in a distributed environment, then use .NET remoting/WS/WCF. I think that remoting will be the fastest choice in your scenario.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文