English 中文(简体)
为支持退学替代设计一个数据库。
原标题:Designing a Database Layer DLL to support drop-in replacement

我很想知道,是否有明智的方法设计C#ll,以便你随后能够重建,并以“安全”的方式将新版本作为退缩的替代。 安全大多意味着签名不会改变。

I was contemplating the differences between using a database primarily via LINQ vs using it primarily with stored procedures. On advantage of stored procedures is that you can change any individual stored procedure without doing a recompile/republish of your application. So, I was contemplating what it would take to have a similar ability by creating a solution where all of the database-oriented code was in a separate project using fun stuff like dbml files and whatnot . Obviously if you stuff garbage on the inside of one of your replacement LINQ functions, the replacement will cause issues, but this disadvantage exists.

我提出的主要规则是:

  • If the database model changes, it is time to do a recompile.
  • Protection against any of the signatures changing. No existing public methods should be removed.

My intuition is that a big part of doing this would involve the use of an interface that was referenced by the separate project and used by the main project in order to make all the calls.

因此,这一想法是否有意义? 是否有任何战略可以用来使这种合理安全(即不增加与编辑储存程序有关的新风险而不重建申请)?

问题回答

www.un.org/Depts/DGACM/index_spanish.htm 你们描述的是什么是“储存”,它们属于“域网设计”。 加上人力资源管理厅(NHibernate, Part Framework),这将使你有一定的灵活性。

然而,你仍会遇到问题。 当你在数据库中找到一个新的领域时,你的班级结构将发生变化,因为你获得了新的公共领域。

我不敢肯定,能否有一个与你的代码基相分离的数据库层,这样,你就可以完全取代你的DLs,但以上可能是一个起点。

有可能将支离破碎的层分开,这样你就能够部署新的DLL。 我们与我们的项目采取了类似的做法。

请注意,我们确实使用NOT执行LINQ或任何其他ORM工具。 相反,我们的DAL代码使用通过企业图书馆提供的定期数据库接入。

关键在于,议会有负责加装和坚持班级的班级和“提供者”。 当我们改换签名时,我们就会更新适当的集会。 有时,这就需要在类别定义中增加其他领域。

当我们补充这些领域时,我们就是否需要这些领域作出决定。 如果是的话,这意味着必须修改主要法,以支持这一和整个共同部署的事物。 否则,我们就只能将新的数据存取大会与主要代码基分开部署。

尽管如此,很罕见的一天,我们物体模式的改变没有以某种方式反映在主要代码基数中(例如新入场)。 内部结构的变化往往足够了,但这些变化完全由SQ处理,不需要更新DAL。





相关问题
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. ...

热门标签