设计问题 - exe vs dll [英] Design question - exe vs dll

查看:73
本文介绍了设计问题 - exe vs dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我对设计决定感到困惑。我需要应用已经在.DLL中编码的业务规则。对于数据库中的每一行,迭代方式从SSIS调用DLL,并且花费的时间太长。所以我计划引入一个.net层来处理内存中的
记录,并使用存储过程在数据库中一次更新所有记录并删除SSIS中的迭代。如果这个图层应该是dll或.exe,我很困惑。因此,新设计应该是SSIS调用.net dll或.net exe,后者又调用业务
层.dll组件。多个包需要调用.net组件的多个实例(exe / dll)。有人可以在性能和实例管理方面提出意见。来自SSIS的Muliple包调用这个新组件可能被视为单独的
线程。我是否需要在新组件(dll / exe)中管理线程。任何细节都会有所帮助。

问候



vishal

Hi all,

I am confused about a design decision. I need to apply business rules which are already coded in .DLL. The DLL was being called from SSIS in iterative fashion for each row in database and was taking too long. so I planned to introducing a .net layer to process records in-memory and update all at once in database using a stored procedure and remove iteration in SSIS. I am confused if this layer should be a dll or .exe. So the new design should be SSIS calling .net dll or a .net exe which in turn calls the business layer .dll components. Multiple packages would need to call multiple instances of .net component(exe/dll). Can someone throw an opinion in terms of performance and instance management. Muliple packages from SSIS calling this new component may be seen as individual threads. Do i need to manage threading in new component (dll/exe). Any details would help.
Regards


vishal

推荐答案

首先让我们清楚".exe"与".exe"之间的区别.dll"在.NET中。

EXE

EXE


  1. EXE的目的是启动一个单独应用它自己。
  2. 一个exe在自己的地址中运行。这是一个单独的过程。


DLL

DLL


  1. DLL总是需要一个主机exe跑步。它不能在自己的地址空间中运行。
  2. DLL的目的是有一组方法/类,可以从其他一些应用程序中重复使用。


DLL的文件格式和EXE基本相同。 Windows通过PE Header
识别文件中DLL和EXE之间的区别。

此外,您似乎不希望代码同步。您可以将操作作为无休止的后台任务。如果您不熟悉
TPL(任务并行库),请参阅以下文章,了解如何在.NET中启动任务。 

所以是的,你将管理外部组件中的线程。

http://dotnetcodr.com/ 2014/01/01 / 5-ways-to-start-a-task-in-net-c /





这篇关于设计问题 - exe vs dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆